summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2015-07-17 20:09:56 +0000
committerSteven Wu <stevenwu@apple.com>2015-07-17 20:09:56 +0000
commit546a19628bc0d1e1e6b2f50d029df4b08e64dfa5 (patch)
treede33d42a65db7410c59f7987a5f2ff2c873eb8db /clang/test/CodeGenObjC
parent76c2f2c9dae885fd51971ba8d3b9709355adeade (diff)
downloadbcm5719-llvm-546a19628bc0d1e1e6b2f50d029df4b08e64dfa5.tar.gz
bcm5719-llvm-546a19628bc0d1e1e6b2f50d029df4b08e64dfa5.zip
Fix -save-temp when using objc-arc, sanitizer and profiling
Currently, -save-temp will cause ObjCARC optimization to be dropped, sanitizer pass to run early in the pipeline, and profiling instrumentation to run twice. Fix the issue by properly disable all passes in the optimization pipeline when generating bitcode output and parse some of the Language Options even when the input is bitcode so the passes can be setup correctly. llvm-svn: 242565
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/arc.ll27
1 files changed, 27 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/arc.ll b/clang/test/CodeGenObjC/arc.ll
new file mode 100644
index 00000000000..caafcff0524
--- /dev/null
+++ b/clang/test/CodeGenObjC/arc.ll
@@ -0,0 +1,27 @@
+; RUN: %clang_cc1 -Os -emit-llvm -fobjc-arc -o - %s | FileCheck %s
+
+target triple = "x86_64-apple-darwin10"
+
+declare i8* @objc_retain(i8*)
+declare void @objc_release(i8*)
+
+; CHECK-LABEL: define void @test(
+; CHECK-NOT: @objc_
+; CHECK: }
+define void @test(i8* %x, i1* %p) nounwind {
+entry:
+ br label %loop
+
+loop:
+ call i8* @objc_retain(i8* %x)
+ %q = load i1, i1* %p
+ br i1 %q, label %loop.more, label %exit
+
+loop.more:
+ call void @objc_release(i8* %x)
+ br label %loop
+
+exit:
+ call void @objc_release(i8* %x)
+ ret void
+}
OpenPOWER on IntegriCloud