192 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-pc-elfiamcu | FileCheck %s3 4%struct.st12_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }5 6define i32 @test_ints(i32 %a, i32 %b, i32 %c, i32 %d) #0 {7; CHECK-LABEL: test_ints:8; CHECK: # %bb.0: # %entry9; CHECK-NEXT: addl %edx, %eax10; CHECK-NEXT: imull %ecx, %eax11; CHECK-NEXT: addl {{[0-9]+}}(%esp), %eax12; CHECK-NEXT: retl13entry:14 %r1 = add i32 %b, %a15 %r2 = mul i32 %c, %r116 %r3 = add i32 %d, %r217 ret i32 %r318}19 20define i32 @test_floats(i32 %a, i32 %b, float %c, float %d) #0 {21; CHECK-LABEL: test_floats:22; CHECK: # %bb.0: # %entry23; CHECK-NEXT: addl %edx, %eax24; CHECK-NEXT: imull %ecx, %eax25; CHECK-NEXT: addl {{[0-9]+}}(%esp), %eax26; CHECK-NEXT: retl27entry:28 %ci = bitcast float %c to i3229 %di = bitcast float %d to i3230 %r1 = add i32 %b, %a31 %r2 = mul i32 %ci, %r132 %r3 = add i32 %di, %r233 ret i32 %r334}35 36define double @test_doubles(double %d1, double %d2) #0 {37; CHECK-LABEL: test_doubles:38; CHECK: # %bb.0: # %entry39; CHECK-NEXT: addl {{[0-9]+}}(%esp), %eax40; CHECK-NEXT: adcl {{[0-9]+}}(%esp), %edx41; CHECK-NEXT: retl42entry:43 %d1i = bitcast double %d1 to i6444 %d2i = bitcast double %d2 to i6445 %r = add i64 %d1i, %d2i46 %rd = bitcast i64 %r to double47 ret double %rd48}49 50define double @test_mixed_doubles(double %d2, i32 %i) #0 {51; CHECK-LABEL: test_mixed_doubles:52; CHECK: # %bb.0: # %entry53; CHECK-NEXT: addl %ecx, %eax54; CHECK-NEXT: adcl $0, %edx55; CHECK-NEXT: retl56entry:57 %iext = zext i32 %i to i6458 %d2i = bitcast double %d2 to i6459 %r = add i64 %iext, %d2i60 %rd = bitcast i64 %r to double61 ret double %rd62}63 64define void @ret_large_struct(ptr noalias nocapture sret(%struct.st12_t) %agg.result, ptr byval(%struct.st12_t) nocapture readonly align 4 %r) #0 {65; CHECK-LABEL: ret_large_struct:66; CHECK: # %bb.0: # %entry67; CHECK-NEXT: pushl %edi68; CHECK-NEXT: pushl %esi69; CHECK-NEXT: leal {{[0-9]+}}(%esp), %esi70; CHECK-NEXT: movl $12, %ecx71; CHECK-NEXT: movl %eax, %edi72; CHECK-NEXT: rep;movsl (%esi), %es:(%edi)73; CHECK-NEXT: popl %esi74; CHECK-NEXT: popl %edi75; CHECK-NEXT: retl76entry:77 call void @llvm.memcpy.p0.p0.i32(ptr %agg.result, ptr %r, i32 48, i1 false)78 ret void79}80 81define i32 @var_args(i32 %i1, ...) #0 {82; CHECK-LABEL: var_args:83; CHECK: # %bb.0: # %entry84; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax85; CHECK-NEXT: retl86entry:87 ret i32 %i188}89 90%struct.S = type { i8 }91 92define i32 @test_lib_args(float %a, float %b) #0 {93; CHECK-LABEL: test_lib_args:94; CHECK: # %bb.0:95; CHECK-NEXT: movl %edx, %eax96; CHECK-NEXT: calll __fixsfsi97; CHECK-NEXT: retl98 %ret = fptosi float %b to i3299 ret i32 %ret100}101 102define i32 @test_fp128(ptr %ptr) #0 {103; CHECK-LABEL: test_fp128:104; CHECK: # %bb.0:105; CHECK-NEXT: pushl 12(%eax)106; CHECK-NEXT: pushl 8(%eax)107; CHECK-NEXT: pushl 4(%eax)108; CHECK-NEXT: pushl (%eax)109; CHECK-NEXT: calll __fixtfsi110; CHECK-NEXT: addl $16, %esp111; CHECK-NEXT: retl112 %v = load fp128, ptr %ptr113 %ret = fptosi fp128 %v to i32114 ret i32 %ret115}116 117declare void @llvm.memcpy.p0.p0.i32(ptr nocapture, ptr nocapture readonly, i32, i1) #1118 119define void @test_alignment_d() #0 {120; CHECK-LABEL: test_alignment_d:121; CHECK: # %bb.0: # %entry122; CHECK-NEXT: subl $8, %esp123; CHECK-NEXT: movl $1073741824, {{[0-9]+}}(%esp) # imm = 0x40000000124; CHECK-NEXT: movl $0, (%esp)125; CHECK-NEXT: movl %esp, %eax126; CHECK-NEXT: calll food@PLT127; CHECK-NEXT: addl $8, %esp128; CHECK-NEXT: retl129entry:130 %d = alloca double131 store double 2.000000e+00, ptr %d132 call void @food(ptr inreg %d)133 ret void134}135 136define void @test_alignment_i() #0 {137; CHECK-LABEL: test_alignment_i:138; CHECK: # %bb.0: # %entry139; CHECK-NEXT: subl $8, %esp140; CHECK-NEXT: movl $0, {{[0-9]+}}(%esp)141; CHECK-NEXT: movl $2, (%esp)142; CHECK-NEXT: movl %esp, %eax143; CHECK-NEXT: calll fooi@PLT144; CHECK-NEXT: addl $8, %esp145; CHECK-NEXT: retl146entry:147 %i = alloca i64148 store i64 2, ptr %i149 call void @fooi(ptr inreg %i)150 ret void151}152 153define void @test_alignment_s() #0 {154; CHECK-LABEL: test_alignment_s:155; CHECK: # %bb.0:156; CHECK-NEXT: pushl %eax157; CHECK-NEXT: movl %esp, %eax158; CHECK-NEXT: calll foos@PLT159; CHECK-NEXT: popl %eax160; CHECK-NEXT: retl161 %s = alloca %struct.S, align 4162 call void @foos(ptr inreg %s)163 ret void164}165 166define void @test_alignment_fp() #0 {167; CHECK-LABEL: test_alignment_fp:168; CHECK: # %bb.0: # %entry169; CHECK-NEXT: subl $16, %esp170; CHECK-NEXT: movl $1073741824, {{[0-9]+}}(%esp) # imm = 0x40000000171; CHECK-NEXT: movl $0, {{[0-9]+}}(%esp)172; CHECK-NEXT: movl $0, {{[0-9]+}}(%esp)173; CHECK-NEXT: movl $0, (%esp)174; CHECK-NEXT: movl %esp, %eax175; CHECK-NEXT: calll foofp@PLT176; CHECK-NEXT: addl $16, %esp177; CHECK-NEXT: retl178entry:179 %f = alloca fp128180 store fp128 0xL00000000000000004000000000000000, ptr %f181 call void @foofp(ptr inreg %f)182 ret void183}184 185declare void @food(ptr inreg)186declare void @fooi(ptr inreg)187declare void @foos(ptr inreg)188declare void @foofp(ptr inreg)189 190attributes #0 = { nounwind "use-soft-float"="true"}191attributes #1 = { nounwind argmemonly }192