summaryrefslogtreecommitdiffstats
path: root/llvm/test/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2018-10-23 23:01:39 +0000
committerLang Hames <lhames@gmail.com>2018-10-23 23:01:39 +0000
commit23cb2e7f7705eea783a8202afe27623eb4e0108e (patch)
tree6f414ab4059f0d452fa568b8e3f992884564d546 /llvm/test/ExecutionEngine
parent7c6344a64f82b6e13ed948ce22f73c4c150f8a4f (diff)
downloadbcm5719-llvm-23cb2e7f7705eea783a8202afe27623eb4e0108e.tar.gz
bcm5719-llvm-23cb2e7f7705eea783a8202afe27623eb4e0108e.zip
[ORC] Re-apply r345077 with fixes to remove ambiguity in lookup calls.
llvm-svn: 345098
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r--llvm/test/ExecutionEngine/OrcLazy/Inputs/hidden-definitions.ll6
-rw-r--r--llvm/test/ExecutionEngine/OrcLazy/hidden-visibility.ll17
2 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/ExecutionEngine/OrcLazy/Inputs/hidden-definitions.ll b/llvm/test/ExecutionEngine/OrcLazy/Inputs/hidden-definitions.ll
new file mode 100644
index 00000000000..8d1f4b9cc5c
--- /dev/null
+++ b/llvm/test/ExecutionEngine/OrcLazy/Inputs/hidden-definitions.ll
@@ -0,0 +1,6 @@
+@bar = hidden global i32 0
+
+define hidden i32 @foo() {
+entry:
+ ret i32 0
+}
diff --git a/llvm/test/ExecutionEngine/OrcLazy/hidden-visibility.ll b/llvm/test/ExecutionEngine/OrcLazy/hidden-visibility.ll
new file mode 100644
index 00000000000..199fd644bff
--- /dev/null
+++ b/llvm/test/ExecutionEngine/OrcLazy/hidden-visibility.ll
@@ -0,0 +1,17 @@
+; RUN: lli -jit-kind=orc-lazy -extra-module %p/Inputs/hidden-definitions.ll %s
+; RUN: not lli -jit-kind=orc-lazy -jd libFoo -extra-module %p/Inputs/hidden-definitions.ll %s
+;
+; Check that hidden symbols in another module are visible when the module is
+; added to the same JITDylib, and not visible if it is added to a different
+; JITDylib.
+
+@bar = external global i32
+declare i32 @foo()
+
+define i32 @main(i32 %argc, i8** nocapture readnone %argv) {
+entry:
+ %0 = call i32() @foo()
+ %1 = load i32, i32* @bar
+ %2 = add i32 %0, %1
+ ret i32 %2
+}
OpenPOWER on IntegriCloud