summaryrefslogtreecommitdiff
path: root/test/Transforms/ObjCARC
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-03-29 21:15:23 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-03-29 21:15:23 +0000
commit3e9f3a0389488701bd1cb5c778d0e785c827d790 (patch)
treeb535070ad57755695d14e9adf2d85557ab2255a6 /test/Transforms/ObjCARC
parent2a88555e0d92a22b50966b223bab19d8518a8f27 (diff)
downloadllvm-3e9f3a0389488701bd1cb5c778d0e785c827d790.tar.gz
llvm-3e9f3a0389488701bd1cb5c778d0e785c827d790.tar.bz2
llvm-3e9f3a0389488701bd1cb5c778d0e785c827d790.tar.xz
Add clang.arc.used to ModuleHasARC so ARC always runs if said call is present in a module.
clang.arc.used is an interesting call for ARC since ObjCARCContract needs to run to remove said intrinsic to avoid a linker error (since the call does not exist). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178369 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/ObjCARC')
-rw-r--r--test/Transforms/ObjCARC/clang-arc-used-intrinsic-removed-if-isolated.ll16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/Transforms/ObjCARC/clang-arc-used-intrinsic-removed-if-isolated.ll b/test/Transforms/ObjCARC/clang-arc-used-intrinsic-removed-if-isolated.ll
new file mode 100644
index 0000000000..4215b5c364
--- /dev/null
+++ b/test/Transforms/ObjCARC/clang-arc-used-intrinsic-removed-if-isolated.ll
@@ -0,0 +1,16 @@
+; RUN: opt -objc-arc-contract -S < %s | FileCheck %s
+
+; This file makes sure that clang.arc.used is removed even if no other ARC
+; interesting calls are in the module.
+
+declare void @clang.arc.use(...) nounwind
+
+; Kill calls to @clang.arc.use(...)
+; CHECK: define void @test0(
+; CHECK-NOT: clang.arc.use
+; CHECK: }
+define void @test0(i8* %a, i8* %b) {
+ call void (...)* @clang.arc.use(i8* %a, i8* %b) nounwind
+ ret void
+}
+