diff --git a/llvm/test/CodeGen/XCore/threads.ll b/llvm/test/CodeGen/XCore/threads.ll --- a/llvm/test/CodeGen/XCore/threads.ll +++ b/llvm/test/CodeGen/XCore/threads.ll @@ -81,6 +81,10 @@ ret i32* getelementptr inbounds ([3 x i32], [3 x i32]* @tl, i32 0, i32 2) } +; This test fails on Windows because the second and third +; register of the add operations are swapped. +; Windows test is below. +; REQUIRES: !windows define i32* @f_tle() { ; CHECK-LABEL: f_tle: ; CHECK: get r11, id @@ -91,6 +95,22 @@ ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) } +; Windows version of the above test. +; REQUIRES: windows +define i32* @f_tle_win() { +; CHECK-LABEL: f_tle_win: +; CHECK: get r11, id +; CHECK: shl [[R0:r[0-9]]], r11, 3 +; CHECK: ldaw [[R1:r[0-9]]], dp[tle] +; r0 = &tl + id*8 +; CHECK: add r0, [[R0]], [[R1]] + ret i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) +} + +; This test fails on Windows because the second and third +; register of the first add operations are swapped. +; Windows test is below. +; REQUIRES: !windows define i32 @f_tlExpr () { ; CHECK-LABEL: f_tlExpr: ; CHECK: get r11, id @@ -103,6 +123,20 @@ i32 ptrtoint( i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) to i32)) } +; Windows version of the above test. +; REQUIRES: windows +define i32 @f_tlExpr_win () { +; CHECK-LABEL: f_tlExpr_win: +; CHECK: get r11, id +; CHECK: shl [[R0:r[0-9]]], r11, 3 +; CHECK: ldaw [[R1:r[0-9]]], dp[tle] +; CHECK: add [[R2:r[0-9]]], [[R0]], [[R1]] +; CHECK: add r0, [[R2]], [[R2]] + ret i32 add( + i32 ptrtoint( i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) to i32), + i32 ptrtoint( i32* getelementptr inbounds ([2 x i32], [2 x i32]* @tle, i32 0, i32 0) to i32)) +} + define void @phiNode1() { ; N.B. lowering of duplicate constexpr in a PHI node requires -O=0 ; PHINODE-LABEL: phiNode1: