[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / CodeGenObjC / objc2-weak-compare.m
blob093a78abc489218a46f349c1f4829621ba3f6528
1 // RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
2 // RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-runtime=macosx-fragile-10.5 -fobjc-gc -emit-llvm -o %t %s
4 @interface PBXTarget 
7 PBXTarget * __weak _lastKnownTarget;
8 PBXTarget * __weak _KnownTarget;
9 PBXTarget * result;
11 - Meth;
12 @end
14 extern void foo(void);
15 @implementation PBXTarget
16 - Meth {
17         if (_lastKnownTarget != result)
18          foo();
19         if (result != _lastKnownTarget)
20          foo();
22         if (_lastKnownTarget != _KnownTarget)
23           foo();
26 @end