150
|
1 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | FileCheck %s -check-prefix=CHECK-O0
|
|
2 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
|
|
3 // RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
|
|
4 // RUN: FileCheck %s -check-prefix=LIFETIME
|
|
5 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
|
|
6 // RUN: -fsanitize=memory %s | \
|
|
7 // RUN: FileCheck %s -check-prefix=LIFETIME
|
|
8 // RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
|
|
9 // RUN: -fsanitize=hwaddress %s | \
|
|
10 // RUN: FileCheck %s -check-prefix=LIFETIME
|
|
11
|
|
12 extern int bar(char *A, int n);
|
|
13
|
|
14 // CHECK-O0-NOT: @llvm.lifetime.start
|
|
15 int foo(int n) {
|
|
16 if (n) {
|
|
17 // LIFETIME: @llvm.lifetime.start.p0i8(i64 10, i8* {{.*}})
|
|
18 char A[10];
|
|
19 return bar(A, 1);
|
|
20 // LIFETIME: @llvm.lifetime.end.p0i8(i64 10, i8* {{.*}})
|
|
21 } else {
|
|
22 // LIFETIME: @llvm.lifetime.start.p0i8(i64 20, i8* {{.*}})
|
|
23 char A[20];
|
|
24 return bar(A, 2);
|
|
25 // LIFETIME: @llvm.lifetime.end.p0i8(i64 20, i8* {{.*}})
|
|
26 }
|
|
27 }
|