summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJF Bastien <jfb@google.com>2015-12-15 02:02:51 +0000
committerJF Bastien <jfb@google.com>2015-12-15 02:02:51 +0000
commit65f0a71f40d2525d9d0c306b528209d21c8dd19e (patch)
tree42f5d8e62935525b21333cf892f16912db78bd3d
parent1c131b37ed5f1baf4515938004abf5e7ba72ce47 (diff)
downloadbcm5719-llvm-65f0a71f40d2525d9d0c306b528209d21c8dd19e.tar.gz
bcm5719-llvm-65f0a71f40d2525d9d0c306b528209d21c8dd19e.zip
WebAssembly: test global array indexing
This case was tested in the linker from code, but not from globals indexing into other globals. The linker currently barfs on this, ncbray volunteered to fix it. llvm-svn: 255601
-rw-r--r--llvm/test/CodeGen/WebAssembly/global.ll9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/WebAssembly/global.ll b/llvm/test/CodeGen/WebAssembly/global.ll
index e00d32b972e..c6bc359a188 100644
--- a/llvm/test/CodeGen/WebAssembly/global.ll
+++ b/llvm/test/CodeGen/WebAssembly/global.ll
@@ -156,3 +156,12 @@ define i8* @call_memcpy(i8* %p, i8* nocapture readonly %q, i32 %n) {
; CHECK-NEXT: .int64 4611686018427387904{{$}}
; CHECK-NEXT: .size f64two, 8{{$}}
@f64two = internal global double 2.0
+
+; Indexing into a global array produces a relocation.
+; CHECK: .type arr,@object
+; CHECK: .type ptr,@object
+; CHECK: ptr:
+; CHECK-NEXT: .int32 arr+80
+; CHECK-NEXT: .size ptr, 4
+@arr = global [128 x i32] zeroinitializer, align 16
+@ptr = global i32* getelementptr inbounds ([128 x i32], [128 x i32]* @arr, i32 0, i32 20), align 4
OpenPOWER on IntegriCloud