2013-03-07 05:32:03 +08:00
|
|
|
; RUN: llc < %s -march=mips -relocation-model=static | \
|
|
|
|
; RUN: FileCheck %s -check-prefix=STATIC-O32
|
|
|
|
; RUN: llc < %s -march=mips -relocation-model=pic | \
|
|
|
|
; RUN: FileCheck %s -check-prefix=PIC-O32
|
2014-04-15 00:00:28 +08:00
|
|
|
; RUN: llc < %s -march=mips64 -relocation-model=pic -mcpu=mips4 | \
|
2017-01-26 18:46:07 +08:00
|
|
|
; RUN: FileCheck %s -check-prefix=N64
|
2014-04-15 00:00:28 +08:00
|
|
|
; RUN: llc < %s -march=mips64 -relocation-model=static -mcpu=mips4 | \
|
2017-01-26 18:46:07 +08:00
|
|
|
; RUN: FileCheck %s -check-prefix=N64
|
2013-03-07 05:32:03 +08:00
|
|
|
; RUN: llc < %s -march=mips64 -relocation-model=pic -mcpu=mips64 | \
|
2017-01-26 18:46:07 +08:00
|
|
|
; RUN: FileCheck %s -check-prefix=N64
|
2013-03-07 05:32:03 +08:00
|
|
|
; RUN: llc < %s -march=mips64 -relocation-model=static -mcpu=mips64 | \
|
2017-01-26 18:46:07 +08:00
|
|
|
; RUN: FileCheck %s -check-prefix=N64
|
2010-07-20 16:37:04 +08:00
|
|
|
|
|
|
|
define i32 @main() nounwind readnone {
|
|
|
|
entry:
|
|
|
|
%x = alloca i32, align 4 ; <i32*> [#uses=2]
|
2011-11-27 14:54:59 +08:00
|
|
|
store volatile i32 2, i32* %x, align 4
|
2015-02-28 05:17:42 +08:00
|
|
|
%0 = load volatile i32, i32* %x, align 4 ; <i32> [#uses=1]
|
2012-06-14 04:33:18 +08:00
|
|
|
; STATIC-O32: sll $[[R0:[0-9]+]], ${{[0-9]+}}, 2
|
|
|
|
; STATIC-O32: lui $[[R1:[0-9]+]], %hi($JTI0_0)
|
|
|
|
; STATIC-O32: addu $[[R2:[0-9]+]], $[[R0]], $[[R1]]
|
|
|
|
; STATIC-O32: lw $[[R3:[0-9]+]], %lo($JTI0_0)($[[R2]])
|
|
|
|
; PIC-O32: sll $[[R0:[0-9]+]], ${{[0-9]+}}, 2
|
|
|
|
; PIC-O32: lw $[[R1:[0-9]+]], %got($JTI0_0)
|
|
|
|
; PIC-O32: addu $[[R2:[0-9]+]], $[[R0]], $[[R1]]
|
|
|
|
; PIC-O32: lw $[[R4:[0-9]+]], %lo($JTI0_0)($[[R2]])
|
2012-05-12 11:25:16 +08:00
|
|
|
; PIC-O32: addu $[[R5:[0-9]+]], $[[R4:[0-9]+]]
|
|
|
|
; PIC-O32: jr $[[R5]]
|
2017-01-26 18:46:07 +08:00
|
|
|
; N64: dsll $[[R0:[0-9]+]], ${{[0-9]+}}, 3
|
|
|
|
; N64: ld $[[R1:[0-9]+]], %got_page(.LJTI0_0)
|
|
|
|
; N64: daddu $[[R2:[0-9]+]], $[[R0:[0-9]+]], $[[R1]]
|
|
|
|
; N64: ld $[[R4:[0-9]+]], %got_ofst(.LJTI0_0)($[[R2]])
|
|
|
|
; N64: daddu $[[R5:[0-9]+]], $[[R4:[0-9]+]]
|
|
|
|
; N64: jr $[[R5]]
|
2010-07-20 16:37:04 +08:00
|
|
|
switch i32 %0, label %bb4 [
|
|
|
|
i32 0, label %bb5
|
|
|
|
i32 1, label %bb1
|
|
|
|
i32 2, label %bb2
|
|
|
|
i32 3, label %bb3
|
|
|
|
]
|
|
|
|
|
|
|
|
bb1: ; preds = %entry
|
|
|
|
ret i32 2
|
|
|
|
|
|
|
|
bb2: ; preds = %entry
|
|
|
|
ret i32 0
|
|
|
|
|
|
|
|
bb3: ; preds = %entry
|
|
|
|
ret i32 3
|
|
|
|
|
|
|
|
bb4: ; preds = %entry
|
|
|
|
ret i32 4
|
|
|
|
|
|
|
|
bb5: ; preds = %entry
|
|
|
|
ret i32 1
|
|
|
|
}
|
2012-02-03 12:33:00 +08:00
|
|
|
|
2016-01-26 08:03:25 +08:00
|
|
|
; STATIC-O32: .p2align 2
|
2012-02-03 12:33:00 +08:00
|
|
|
; STATIC-O32: $JTI0_0:
|
|
|
|
; STATIC-O32: .4byte
|
|
|
|
; STATIC-O32: .4byte
|
|
|
|
; STATIC-O32: .4byte
|
|
|
|
; STATIC-O32: .4byte
|
2016-01-26 08:03:25 +08:00
|
|
|
; PIC-O32: .p2align 2
|
2012-02-03 12:33:00 +08:00
|
|
|
; PIC-O32: $JTI0_0:
|
|
|
|
; PIC-O32: .gpword
|
|
|
|
; PIC-O32: .gpword
|
2017-01-26 18:46:07 +08:00
|
|
|
; PIC-O32: .gpword
|
|
|
|
; PIC-O32: .gpword
|
|
|
|
; N64: .p2align 3
|
|
|
|
; N64: .LJTI0_0:
|
|
|
|
; N64: .gpdword
|
|
|
|
; N64: .gpdword
|
|
|
|
; N64: .gpdword
|
|
|
|
; N64: .gpdword
|
2012-02-03 12:33:00 +08:00
|
|
|
|