summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/annotations-var.c
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-09-10 01:37:23 +0000
committerJohn McCall <rjmccall@apple.com>2011-09-10 01:37:23 +0000
commite5e7e6bc84a5d0b2ef68163640c09c303958649d (patch)
treeb3e2001b6c3244ef9926a43ce3b5d6ea67b79f10 /clang/test/CodeGen/annotations-var.c
parentd9917bef6ca582f1ca3def692c1c21b296666bd2 (diff)
downloadbcm5719-llvm-e5e7e6bc84a5d0b2ef68163640c09c303958649d.tar.gz
bcm5719-llvm-e5e7e6bc84a5d0b2ef68163640c09c303958649d.zip
Make this test not depend on unnecessary details and IR variable names.
llvm-svn: 139455
Diffstat (limited to 'clang/test/CodeGen/annotations-var.c')
-rw-r--r--clang/test/CodeGen/annotations-var.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/clang/test/CodeGen/annotations-var.c b/clang/test/CodeGen/annotations-var.c
index 97a10ac3151..60a1b438746 100644
--- a/clang/test/CodeGen/annotations-var.c
+++ b/clang/test/CodeGen/annotations-var.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o %t1 %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o %t1 %s
// RUN: FileCheck --check-prefix=LOCAL %s < %t1
// RUN: FileCheck --check-prefix=UNDEF %s < %t1
// RUN: FileCheck --check-prefix=PARAM %s < %t1
@@ -28,16 +28,20 @@ int foo(int v __attribute__((annotate("param_ann_0"))) __attribute__((annotate("
// PARAM-NEXT: call void @llvm.var.annotation(
}
-int main(int argc, char **argv) {
+void local(void) {
int localvar __attribute__((annotate("localvar_ann_0"))) __attribute__((annotate("localvar_ann_1"))) = 3;
-// LOCAL: %localvar1 = bitcast i32* %localvar to i8*
-// LOCAL-NEXT: call void @llvm.var.annotation(i8* %localvar1, i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 32)
-// LOCAL-NEXT: %localvar2 = bitcast i32* %localvar to i8*
-// LOCAL-NEXT: call void @llvm.var.annotation(i8* %localvar2, i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 32)
+// LOCAL: define void @local()
+// LOCAL: [[LOCALVAR:%.*]] = alloca i32,
+// LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8*
+// LOCAL-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 32)
+// LOCAL-NEXT: [[T0:%.*]] = bitcast i32* [[LOCALVAR]] to i8*
+// LOCAL-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 32)
+}
+
+void undef(void) {
int undefvar __attribute__((annotate("undefvar_ann_0")));
-// UNDEF: %undefvar3 = bitcast i32* %undefvar to i8*
-// UNDEF-NEXT: call void @llvm.var.annotation(i8* %undefvar3, i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 37)
- localvar += argc;
- undefvar = localvar;
- return undefvar + localvar;
+// UNDEF: define void @undef()
+// UNDEF: [[UNDEFVAR:%.*]] = alloca i32,
+// UNDEF-NEXT: [[T0:%.*]] = bitcast i32* [[UNDEFVAR]] to i8*
+// UNDEF-NEXT: call void @llvm.var.annotation(i8* [[T0]], i8* getelementptr inbounds ([15 x i8]* @{{.*}}), i8* getelementptr inbounds ({{.*}}), i32 42)
}
OpenPOWER on IntegriCloud