summaryrefslogtreecommitdiffstats
path: root/llvm/test/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2016-08-01 22:23:24 +0000
committerLang Hames <lhames@gmail.com>2016-08-01 22:23:24 +0000
commit7643d98d8685fc9159b0221a6910b8f4ef872df5 (patch)
tree2e5fa10f95285fb52640e8c6855fa1e8fa78e43d /llvm/test/ExecutionEngine
parent78fb132af094873fb6e042f1f77f6d25c6da2c0c (diff)
downloadbcm5719-llvm-7643d98d8685fc9159b0221a6910b8f4ef872df5.tar.gz
bcm5719-llvm-7643d98d8685fc9159b0221a6910b8f4ef872df5.zip
[Orc] Fix common symbol support in ORC.
Common symbol support in ORC was broken in r270716 when the symbol resolution rules in RuntimeDyld were changed. With the switch to lazily materialized symbols in r277386, common symbols can be supported by having RuntimeDyld::emitCommonSymbols search for (but not materialize!) definitions elsewhere in the logical dylib. This patch adds the 'Common' flag to JITSymbolFlags, and the necessary check to RuntimeDyld::emitCommonSymbols. llvm-svn: 277397
Diffstat (limited to 'llvm/test/ExecutionEngine')
-rw-r--r--llvm/test/ExecutionEngine/OrcLazy/common-symbols.ll18
1 files changed, 18 insertions, 0 deletions
diff --git a/llvm/test/ExecutionEngine/OrcLazy/common-symbols.ll b/llvm/test/ExecutionEngine/OrcLazy/common-symbols.ll
new file mode 100644
index 00000000000..ece490ae8c8
--- /dev/null
+++ b/llvm/test/ExecutionEngine/OrcLazy/common-symbols.ll
@@ -0,0 +1,18 @@
+; RUN: lli -jit-kind=orc-lazy %s | FileCheck %s
+;
+; CHECK: 7
+
+@x = common global i32 0, align 4
+@.str = private unnamed_addr constant [4 x i8] c"%d\0A\00", align 1
+
+define i32 @main() {
+entry:
+ %retval = alloca i32, align 4
+ store i32 0, i32* %retval, align 4
+ store i32 7, i32* @x, align 4
+ %0 = load i32, i32* @x, align 4
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %0)
+ ret i32 0
+}
+
+declare i32 @printf(i8*, ...)
OpenPOWER on IntegriCloud