Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -mtriple=i686-linux-gnu -o - %s | FileCheck %s
      2 
      3 @var = global i128 0
      4 
      5 ; We were trying to convert the i128 operation into a libcall, but failing to
      6 ; perform sret demotion when we couldn't return the result in registers. Make
      7 ; sure we marshal the return properly:
      8 
      9 define void @test_sret_libcall(i128 %l, i128 %r) {
     10 ; CHECK-LABEL: test_sret_libcall:
     11 
     12   ; Stack for call: 4(sret ptr), 16(i128 %l), 16(128 %r). So next logical
     13   ; (aligned) place for the actual sret data is %esp + 40.
     14 ; CHECK: leal 40(%esp), [[SRET_ADDR:%[a-z]+]]
     15 ; CHECK: movl [[SRET_ADDR]], (%esp)
     16 ; CHECK: calll __multi3
     17 ; CHECK-DAG: movl 40(%esp), [[RES0:%[a-z]+]]
     18 ; CHECK-DAG: movl 44(%esp), [[RES1:%[a-z]+]]
     19 ; CHECK-DAG: movl 48(%esp), [[RES2:%[a-z]+]]
     20 ; CHECK-DAG: movl 52(%esp), [[RES3:%[a-z]+]]
     21 ; CHECK-DAG: movl [[RES0]], var
     22 ; CHECK-DAG: movl [[RES1]], var+4
     23 ; CHECK-DAG: movl [[RES2]], var+8
     24 ; CHECK-DAG: movl [[RES3]], var+12
     25   %prod = mul i128 %l, %r
     26   store i128 %prod, i128* @var
     27   ret void
     28 }
     29