2016-06-09 02:18:08 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 %s | FileCheck %s -check-prefix=CHECK-O0
|
|
|
|
// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
|
2016-06-02 08:24:20 +08:00
|
|
|
// RUN: -fsanitize=address -fsanitize-address-use-after-scope %s | \
|
2019-08-24 09:31:38 +08:00
|
|
|
// RUN: FileCheck %s -check-prefix=LIFETIME
|
2019-08-27 06:15:50 +08:00
|
|
|
// RUN: %clang -target x86_64-linux-gnu -S -emit-llvm -o - -O0 \
|
|
|
|
// RUN: -fsanitize=memory %s | \
|
|
|
|
// RUN: FileCheck %s -check-prefix=LIFETIME
|
2019-08-27 06:16:05 +08:00
|
|
|
// RUN: %clang -target aarch64-linux-gnu -S -emit-llvm -o - -O0 \
|
|
|
|
// RUN: -fsanitize=hwaddress %s | \
|
|
|
|
// RUN: FileCheck %s -check-prefix=LIFETIME
|
2016-06-02 08:24:20 +08:00
|
|
|
|
|
|
|
extern int bar(char *A, int n);
|
|
|
|
|
|
|
|
// CHECK-O0-NOT: @llvm.lifetime.start
|
|
|
|
int foo(int n) {
|
|
|
|
if (n) {
|
2019-08-24 09:31:38 +08:00
|
|
|
// LIFETIME: @llvm.lifetime.start.p0i8(i64 10, i8* {{.*}})
|
2016-06-02 08:24:20 +08:00
|
|
|
char A[10];
|
|
|
|
return bar(A, 1);
|
2019-08-24 09:31:38 +08:00
|
|
|
// LIFETIME: @llvm.lifetime.end.p0i8(i64 10, i8* {{.*}})
|
2016-06-02 08:24:20 +08:00
|
|
|
} else {
|
2019-08-24 09:31:38 +08:00
|
|
|
// LIFETIME: @llvm.lifetime.start.p0i8(i64 20, i8* {{.*}})
|
2016-06-02 08:24:20 +08:00
|
|
|
char A[20];
|
|
|
|
return bar(A, 2);
|
2019-08-24 09:31:38 +08:00
|
|
|
// LIFETIME: @llvm.lifetime.end.p0i8(i64 20, i8* {{.*}})
|
2016-06-02 08:24:20 +08:00
|
|
|
}
|
|
|
|
}
|