зеркало из https://github.com/microsoft/clang.git
Make this test not depend on unnecessary details and IR variable names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139455 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
dc05b11c67
Коммит
bf379a6571
|
@ -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)
|
||||
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;
|
||||
// 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: 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)
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче