[llvm] r255601 - WebAssembly: test global array indexing

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 18:02:54 PST 2015


Author: jfb
Date: Mon Dec 14 20:02:51 2015
New Revision: 255601

URL: http://llvm.org/viewvc/llvm-project?rev=255601&view=rev
Log:
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.

Modified:
    llvm/trunk/test/CodeGen/WebAssembly/global.ll

Modified: llvm/trunk/test/CodeGen/WebAssembly/global.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/global.ll?rev=255601&r1=255600&r2=255601&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/global.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/global.ll Mon Dec 14 20:02:51 2015
@@ -156,3 +156,12 @@ define i8* @call_memcpy(i8* %p, i8* noca
 ; 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, at object
+; CHECK:      .type ptr, at object
+; CHECK:      ptr:
+; CHECK-NEXT: .int32 arr+80
+; CHECK-NEXT: .size ptr, 4
+ at arr = global [128 x i32] zeroinitializer, align 16
+ at ptr = global i32* getelementptr inbounds ([128 x i32], [128 x i32]* @arr, i32 0, i32 20), align 4




More information about the llvm-commits mailing list