mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
test case for annotate attribute
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
6d806e93ce
commit
bedcd3bb9d
25
test/CFrontend/2007-06-15-AnnotateAttribute.c
Normal file
25
test/CFrontend/2007-06-15-AnnotateAttribute.c
Normal file
@ -0,0 +1,25 @@
|
||||
// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep llvm.global.annotations | grep foo \
|
||||
// RUN: | grep @X | grep @a
|
||||
// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep -c llvm.var.annotation | grep 3
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Global variable with attribute */
|
||||
int X __attribute__((annotate("GlobalValAnnotation")));
|
||||
|
||||
/* Function with attribute */
|
||||
int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
|
||||
__attribute__((noinline));
|
||||
|
||||
int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
|
||||
int x __attribute__((annotate("LocalValAnnotation")));
|
||||
x = 34;
|
||||
return y + x;
|
||||
}
|
||||
|
||||
int main() {
|
||||
static int a __attribute__((annotate("GlobalValAnnotation")));
|
||||
a = foo(2);
|
||||
printf("hello world%d\n", a);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user