diff options
| author | Akira Hatanaka <ahatanaka@apple.com> | 2019-10-23 07:38:52 -0700 |
|---|---|---|
| committer | Akira Hatanaka <ahatanaka@apple.com> | 2019-10-24 13:08:50 -0700 |
| commit | 31b752cbf0db5a022ec21a9db5bd217c46f5cf4a (patch) | |
| tree | 76618234e9e11eeeff15dbf2052776316a4356dc /llvm/test/Bitcode | |
| parent | a5376f6322132e3b0664de55348f6bbba1fabd00 (diff) | |
| download | bcm5719-llvm-31b752cbf0db5a022ec21a9db5bd217c46f5cf4a.tar.gz bcm5719-llvm-31b752cbf0db5a022ec21a9db5bd217c46f5cf4a.zip | |
[ObjC][ARC] Check whether the return and parameter types of the old and
new functions are compatible before upgrading a function call to an
intrinsic call.
Sometimes users insert calls to ARC runtime functions that are not
compatible with the corresponding intrinsic functions (for example,
'i8* @objc_storeStrong' instead of 'void @objc_storeStrong'). Don't
upgrade those calls.
rdar://problem/56447127
Diffstat (limited to 'llvm/test/Bitcode')
| -rw-r--r-- | llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.bc | bin | 0 -> 1536 bytes | |||
| -rw-r--r-- | llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.ll | 21 |
2 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.bc b/llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.bc Binary files differnew file mode 100644 index 00000000000..f2af475b26c --- /dev/null +++ b/llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.bc diff --git a/llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.ll b/llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.ll new file mode 100644 index 00000000000..deac12d36df --- /dev/null +++ b/llvm/test/Bitcode/upgrade-arc-runtime-calls-bitcast.ll @@ -0,0 +1,21 @@ +target triple = "arm64-apple-ios7.0" + +; RUN: llvm-dis < %S/upgrade-arc-runtime-calls-bitcast.bc | FileCheck %s + +; CHECK: tail call i8* @objc_retain(i32 1) +; CHECK: tail call i8* @objc_storeStrong( + +define void @testRuntimeCalls(i8* %a, i8** %b) { + %v6 = tail call i8* @objc_retain(i32 1) + %1 = tail call i8* @objc_storeStrong(i8** %b, i8* %a) + ret void +} + +declare i8* @objc_retain(i32) +declare i8* @objc_storeStrong(i8**, i8*) + +attributes #0 = { nounwind } + +!llvm.module.flags = !{!0} + +!0 = !{i32 1, !"clang.arc.retainAutoreleasedReturnValueMarker", !"mov\09fp, fp\09\09; marker for objc_retainAutoreleaseReturnValue"} |

