[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGenObjCXX / address-safety-attr.mm
blob1b6f0e807afd6ec76d842f52e3fef80df614145e
1 // RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck -check-prefix=WITHOUT %s
2 // RUN: %clang_cc1 -emit-llvm -o - %s -fsanitize=address | FileCheck -check-prefix=ASAN %s
4 @interface MyClass
5 + (int) addressSafety:(int*)a;
6 @end
8 @implementation MyClass
10 // WITHOUT:  +[MyClass load]{{.*}}#0
11 // ASAN: +[MyClass load]{{.*}}#0
12 +(void) load { }
14 // WITHOUT:  +[MyClass addressSafety:]{{.*}}#0
15 // ASAN:  +[MyClass addressSafety:]{{.*}}#0
16 + (int) addressSafety:(int*)a { return *a; }
18 @end
20 // ASAN: attributes #0 = {{.*}}sanitize_address
21 // WITHOUT-NOT: attributes #0 = {{.*}}sanitize_address