blob: 062ff7c9059e8b53927bc2134182f2d4f9b57f87 [file] [log] [blame]
Akira Hatanakae11246c2012-07-26 02:24:43 +00001; RUN: llc -march=mipsel -mcpu=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=C1
2; RUN: llc -march=mipsel -mcpu=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=C2
3; RUN: llc -march=mipsel -mcpu=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=PE
4; RUN: llc -march=mipsel -mcpu=mips16 -relocation-model=pic -O3 < %s | FileCheck %s -check-prefix=SR
5
6
7@.str = private unnamed_addr constant [13 x i8] c"hello world\0A\00", align 1
8
9define i32 @main() nounwind {
10entry:
11 %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([13 x i8]* @.str, i32 0, i32 0))
12 ret i32 0
13
14; SR: .set mips16 # @main
15
16; SR: save $ra, [[FS:[0-9]+]]
17; PE: li $[[T1:[0-9]+]], %hi(_gp_disp)
18; PE: addiu $[[T2:[0-9]+]], $pc, %lo(_gp_disp)
19; PE: sll $[[T3:[0-9]+]], $[[T1]], 16
20; C1: lw ${{[0-9]+}}, %got($.str)(${{[0-9]+}})
21; C2: lw ${{[0-9]+}}, %call16(printf)(${{[0-9]+}})
22; C1: addiu ${{[0-9]+}}, %lo($.str)
23; C2: move $25, ${{[0-9]+}}
24; C1: move $gp, ${{[0-9]+}}
25; C1: jalr ${{[0-9]+}}
26; SR: restore $ra, [[FS]]
27; PE: li $2, 0
28; PE: jr $ra
29
30}
31
32declare i32 @printf(i8*, ...)