[llvm] r258693 - [WebAssembly] Add tests for negative offsets with global variable addresses.
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 25 07:19:42 PST 2016
Author: djg
Date: Mon Jan 25 09:19:39 2016
New Revision: 258693
URL: http://llvm.org/viewvc/llvm-project?rev=258693&view=rev
Log:
[WebAssembly] Add tests for negative offsets with global variable addresses.
Modified:
llvm/trunk/test/CodeGen/WebAssembly/offset-folding.ll
Modified: llvm/trunk/test/CodeGen/WebAssembly/offset-folding.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/offset-folding.ll?rev=258693&r1=258692&r2=258693&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/offset-folding.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/offset-folding.ll Mon Jan 25 09:19:39 2016
@@ -43,3 +43,21 @@ define i32* @test2() {
define i32* @test3() {
ret i32* getelementptr ([50 x i32], [50 x i32]* @y, i32 0, i32 0)
}
+
+; Test negative offsets.
+
+; CHECK-LABEL: test4:
+; CHECK-NEXT: .result i32{{$}}
+; CHECK-NEXT: i32.const $push0=, x-188{{$}}
+; CHECK=NEXT: return $pop0{{$}}
+define i32* @test4() {
+ ret i32* getelementptr ([0 x i32], [0 x i32]* @x, i32 0, i32 -47)
+}
+
+; CHECK-LABEL: test5:
+; CHECK-NEXT: .result i32{{$}}
+; CHECK-NEXT: i32.const $push0=, y-188{{$}}
+; CHECK=NEXT: return $pop0{{$}}
+define i32* @test5() {
+ ret i32* getelementptr ([50 x i32], [50 x i32]* @y, i32 0, i32 -47)
+}
More information about the llvm-commits
mailing list