summaryrefslogtreecommitdiff
path: root/clang/test/CodeGenObjC/objc2-weak-compare.m
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/CodeGenObjC/objc2-weak-compare.m')
-rw-r--r--clang/test/CodeGenObjC/objc2-weak-compare.m26
1 files changed, 26 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/objc2-weak-compare.m b/clang/test/CodeGenObjC/objc2-weak-compare.m
new file mode 100644
index 0000000..75cf689
--- /dev/null
+++ b/clang/test/CodeGenObjC/objc2-weak-compare.m
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -triple i386-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s
+// RUN: %clang_cc1 -x objective-c++ -triple i386-apple-darwin9 -fobjc-fragile-abi -fobjc-gc -emit-llvm -o %t %s
+
+@interface PBXTarget
+{
+
+PBXTarget * __weak _lastKnownTarget;
+PBXTarget * __weak _KnownTarget;
+PBXTarget * result;
+}
+- Meth;
+@end
+
+extern void foo();
+@implementation PBXTarget
+- Meth {
+ if (_lastKnownTarget != result)
+ foo();
+ if (result != _lastKnownTarget)
+ foo();
+
+ if (_lastKnownTarget != _KnownTarget)
+ foo();
+}
+
+@end