teak-llvm/clang/test/CodeGenObjC/arc.ll
Steven Wu 546a19628b 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
2015-07-17 20:09:56 +00:00

28 lines
527 B
LLVM

; 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
}