xref: /aosp_15_r20/external/llvm/test/CodeGen/Mips/sr1.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc  -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static  < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; RUN: llc  -mtriple=mipsel-linux-gnu -march=mipsel -mattr=mips16 -relocation-model=static  < %s | FileCheck %s -check-prefix=NEG
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker@f = common global float 0.000000e+00, align 4
6*9880d681SAndroid Build Coastguard Worker
7*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind
8*9880d681SAndroid Build Coastguard Workerdefine void @foo1() #0 {
9*9880d681SAndroid Build Coastguard Workerentry:
10*9880d681SAndroid Build Coastguard Worker  %c = alloca [10 x i8], align 1
11*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [10 x i8], [10 x i8]* %c, i32 0, i32 0
12*9880d681SAndroid Build Coastguard Worker  call void @x(i8* %arraydecay)
13*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [10 x i8], [10 x i8]* %c, i32 0, i32 0
14*9880d681SAndroid Build Coastguard Worker  call void @x(i8* %arraydecay1)
15*9880d681SAndroid Build Coastguard Worker  ret void
16*9880d681SAndroid Build Coastguard Worker; CHECK: 	.ent	foo1
17*9880d681SAndroid Build Coastguard Worker; CHECK: 	save	$16, $17, $ra, [[FS:[0-9]+]]  # 16 bit inst
18*9880d681SAndroid Build Coastguard Worker; CHECK: 	restore	$16, $17, $ra, [[FS]] # 16 bit inst
19*9880d681SAndroid Build Coastguard Worker; CHECK: 	.end	foo1
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdeclare void @x(i8*) #1
23*9880d681SAndroid Build Coastguard Worker
24*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind
25*9880d681SAndroid Build Coastguard Workerdefine void @foo2() #0 {
26*9880d681SAndroid Build Coastguard Workerentry:
27*9880d681SAndroid Build Coastguard Worker  %c = alloca [150 x i8], align 1
28*9880d681SAndroid Build Coastguard Worker  %arraydecay = getelementptr inbounds [150 x i8], [150 x i8]* %c, i32 0, i32 0
29*9880d681SAndroid Build Coastguard Worker  call void @x(i8* %arraydecay)
30*9880d681SAndroid Build Coastguard Worker  %arraydecay1 = getelementptr inbounds [150 x i8], [150 x i8]* %c, i32 0, i32 0
31*9880d681SAndroid Build Coastguard Worker  call void @x(i8* %arraydecay1)
32*9880d681SAndroid Build Coastguard Worker  ret void
33*9880d681SAndroid Build Coastguard Worker; CHECK: 	.ent	foo2
34*9880d681SAndroid Build Coastguard Worker; CHECK: 	save	$16, $17, $ra, [[FS:[0-9]+]]
35*9880d681SAndroid Build Coastguard Worker; CHECK: 	restore	$16, $17, $ra, [[FS]]
36*9880d681SAndroid Build Coastguard Worker; CHECK: 	.end	foo2
37*9880d681SAndroid Build Coastguard Worker}
38*9880d681SAndroid Build Coastguard Worker
39*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind
40*9880d681SAndroid Build Coastguard Workerdefine void @foo3() #0 {
41*9880d681SAndroid Build Coastguard Workerentry:
42*9880d681SAndroid Build Coastguard Worker  %call = call float @xf()
43*9880d681SAndroid Build Coastguard Worker  store float %call, float* @f, align 4
44*9880d681SAndroid Build Coastguard Worker  ret void
45*9880d681SAndroid Build Coastguard Worker; CHECK: 	.ent	foo3
46*9880d681SAndroid Build Coastguard Worker; CHECK: 	save	$16, $17, $ra, $18, [[FS:[0-9]+]]
47*9880d681SAndroid Build Coastguard Worker; CHECK: 	restore	$16, $17, $ra, $18, [[FS]]
48*9880d681SAndroid Build Coastguard Worker; CHECK: 	.end	foo3
49*9880d681SAndroid Build Coastguard Worker; NEG: 	.ent	foo3
50*9880d681SAndroid Build Coastguard Worker; NEG-NOT: 	save	$16, $17, $ra, $18, [[FS:[0-9]+]] # 16 bit inst
51*9880d681SAndroid Build Coastguard Worker; NEG-NOT: 	restore	$16, $17, $ra, $18, [[FS]] # 16 bit inst
52*9880d681SAndroid Build Coastguard Worker; NEG: 	.end	foo3
53*9880d681SAndroid Build Coastguard Worker}
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Workerdeclare float @xf() #1
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
58*9880d681SAndroid Build Coastguard Workerattributes #1 = { "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker
61