summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-07-08 02:13:47 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-07-08 02:13:47 +0000
commit8c96263ee36e7f078db4cc4e3bdb239959006dd4 (patch)
treede381203c8112a8f7dd9caf09326eaa38245194e
parent43b51056d6055c40d85de50df776605b72a61d26 (diff)
downloadbcm5719-llvm-8c96263ee36e7f078db4cc4e3bdb239959006dd4.tar.gz
bcm5719-llvm-8c96263ee36e7f078db4cc4e3bdb239959006dd4.zip
[objc-arc] Committed test for r185770 as per dblaikie's suggestion.
llvm-svn: 185782
-rw-r--r--llvm/test/Transforms/ObjCARC/gvn.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ObjCARC/gvn.ll b/llvm/test/Transforms/ObjCARC/gvn.ll
index 8d9b1bb84b8..1c55ee5c8ab 100644
--- a/llvm/test/Transforms/ObjCARC/gvn.ll
+++ b/llvm/test/Transforms/ObjCARC/gvn.ll
@@ -3,6 +3,8 @@
@x = common global i8* null, align 8
declare i8* @objc_retain(i8*)
+declare i32 @objc_sync_enter(i8*)
+declare i32 @objc_sync_exit(i8*)
; GVN should be able to eliminate this redundant load, with ARC-specific
; alias analysis.
@@ -20,3 +22,20 @@ entry:
%t = load i8** @x
ret i8* %t
}
+
+; GVN should not be able to eliminate this redundant load, with ARC-specific
+; alias analysis.
+
+; CHECK: define i8* @test1
+; CHECK: load
+; CHECK: load
+; CHECK: ret i8* %t
+; CHECK: }
+define i8* @test1(i32 %n) nounwind {
+entry:
+ %s = load i8** @x
+ %0 = call i32 @objc_sync_enter(i8* %s)
+ %t = load i8** @x
+ %1 = call i32 @objc_sync_exit(i8* %s)
+ ret i8* %t
+}
OpenPOWER on IntegriCloud