[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CodeGen / lifetime-sanitizer.c
blobb15d692b79e3663b5fcd8ef69e53295d231a477e
1 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
2 // RUN: -Xclang -disable-llvm-passes %s | FileCheck %s -check-prefix=CHECK-O0
3 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
4 // RUN: -fsanitize=address -fsanitize-address-use-after-scope \
5 // RUN: -Xclang -disable-llvm-passes %s | FileCheck %s -check-prefix=LIFETIME
6 // RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
7 // RUN: -fsanitize=memory -Xclang -disable-llvm-passes %s | \
8 // RUN: FileCheck %s -check-prefix=LIFETIME
9 // RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
10 // RUN: -fsanitize=hwaddress -Xclang -disable-llvm-passes %s | \
11 // RUN: FileCheck %s -check-prefix=LIFETIME
13 extern int bar(char *A, int n);
15 // CHECK-O0-NOT: @llvm.lifetime.start
16 int foo(int n) {
17 if (n) {
18 // LIFETIME: @llvm.lifetime.start.p0(i64 10, ptr {{.*}})
19 char A[10];
20 return bar(A, 1);
21 // LIFETIME: @llvm.lifetime.end.p0(i64 10, ptr {{.*}})
22 } else {
23 // LIFETIME: @llvm.lifetime.start.p0(i64 20, ptr {{.*}})
24 char A[20];
25 return bar(A, 2);
26 // LIFETIME: @llvm.lifetime.end.p0(i64 20, ptr {{.*}})