blob: 6653cfb14ed81a256e940e2d3b6f8008c7789104 [file] [log] [blame]
Rafael Espindola1cee7102012-07-25 13:41:10 +00001; RUN: llc < %s -mtriple=i686-pc-linux -mcpu=corei7 | FileCheck --check-prefix=DAG %s
2; RUN: llc < %s -mtriple=i686-pc-linux -mcpu=corei7 -O0 | FileCheck --check-prefix=FAST %s
Rafael Espindolacde227b2012-07-24 21:40:17 +00003
Rafael Espindola1cee7102012-07-25 13:41:10 +00004%struct.s1 = type { double, float }
Rafael Espindolacde227b2012-07-24 21:40:17 +00005
Rafael Espindola1cee7102012-07-25 13:41:10 +00006define void @g1() nounwind {
Rafael Espindolacde227b2012-07-24 21:40:17 +00007entry:
Rafael Espindola1cee7102012-07-25 13:41:10 +00008 %tmp = alloca %struct.s1, align 4
9 call void @f(%struct.s1* inreg sret %tmp, i32 inreg 41, i32 inreg 42, i32 43)
Rafael Espindolacde227b2012-07-24 21:40:17 +000010 ret void
Rafael Espindola1cee7102012-07-25 13:41:10 +000011 ; DAG: g1:
12 ; DAG: subl $[[AMT:.*]], %esp
13 ; DAG-NEXT: $43, (%esp)
14 ; DAG-NEXT: leal 16(%esp), %eax
15 ; DAG-NEXT: movl $41, %edx
16 ; DAG-NEXT: movl $42, %ecx
17 ; DAG-NEXT: calll f
18 ; DAG-NEXT: addl $[[AMT]], %esp
19 ; DAG-NEXT: ret
20
21 ; FAST: g1:
22 ; FAST: subl $[[AMT:.*]], %esp
23 ; FAST-NEXT: leal 8(%esp), %eax
24 ; FAST-NEXT: movl $41, %edx
25 ; FAST-NEXT: movl $42, %ecx
26 ; FAST: $43, (%esp)
27 ; FAST: calll f
28 ; FAST-NEXT: addl $[[AMT]], %esp
29 ; FAST: ret
Rafael Espindolacde227b2012-07-24 21:40:17 +000030}
31
Rafael Espindola1cee7102012-07-25 13:41:10 +000032declare void @f(%struct.s1* inreg sret, i32 inreg, i32 inreg, i32)
33
34%struct.s2 = type {}
35
36define void @g2(%struct.s2* inreg sret %agg.result) nounwind {
37entry:
38 ret void
39 ; DAG: g2
40 ; DAG-NOT: ret $4
41 ; DAG: .size g2
42
43 ; FAST: g2
44 ; FAST-NOT: ret $4
45 ; FAST: .size g2
46}