diff options
author | Lang Hames <lhames@gmail.com> | 2016-08-09 19:27:17 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2016-08-09 19:27:17 +0000 |
commit | 04d404bad2a4338841d5ab5f0ec3908bbd62fa1a (patch) | |
tree | 291bcba7a682081eb1f0a90cde5dbdb9b2638799 /test/ExecutionEngine/MCJIT | |
parent | c93602e15af3c18ad01902df37066ff6f74ae3b8 (diff) | |
download | llvm-04d404bad2a4338841d5ab5f0ec3908bbd62fa1a.tar.gz |
Re-apply r278065 (Weak symbol support in RuntimeDyld) with a fix for ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@278149 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ExecutionEngine/MCJIT')
-rw-r--r-- | test/ExecutionEngine/MCJIT/Inputs/weak-function-2.ll | 9 | ||||
-rw-r--r-- | test/ExecutionEngine/MCJIT/weak-function.ll | 26 |
2 files changed, 35 insertions, 0 deletions
diff --git a/test/ExecutionEngine/MCJIT/Inputs/weak-function-2.ll b/test/ExecutionEngine/MCJIT/Inputs/weak-function-2.ll new file mode 100644 index 000000000000..a7ff83df0398 --- /dev/null +++ b/test/ExecutionEngine/MCJIT/Inputs/weak-function-2.ll @@ -0,0 +1,9 @@ +define linkonce_odr i32 @baz() #0 { +entry: + ret i32 0 +} + +define i8* @bar() { +entry: + ret i8* bitcast (i32 ()* @baz to i8*) +} diff --git a/test/ExecutionEngine/MCJIT/weak-function.ll b/test/ExecutionEngine/MCJIT/weak-function.ll new file mode 100644 index 000000000000..562d6ade33b3 --- /dev/null +++ b/test/ExecutionEngine/MCJIT/weak-function.ll @@ -0,0 +1,26 @@ +; RUN: lli -jit-kind=mcjit -extra-module %p/Inputs/weak-function-2.ll %s +; +; Check that functions in two different modules agree on the address of weak +; function 'baz' + +define linkonce_odr i32 @baz() { +entry: + ret i32 0 +} + +define i8* @foo() { +entry: + ret i8* bitcast (i32 ()* @baz to i8*) +} + +declare i8* @bar() + +define i32 @main(i32 %argc, i8** %argv) { +entry: + %call = tail call i8* @foo() + %call1 = tail call i8* @bar() + %cmp = icmp ne i8* %call, %call1 + %conv = zext i1 %cmp to i32 + ret i32 %conv +} + |