Dan Gohman | 0a06310 | 2009-09-08 23:54:48 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86 -tailcallopt | grep TAILCALL |
| 2 | ; RUN: llc < %s -march=x86 -tailcallopt | grep {movl\[\[:space:\]\]*4(%esp), %eax} | count 1 |
Arnold Schwaighofer | a38df10 | 2008-04-12 18:11:06 +0000 | [diff] [blame] | 3 | %struct.s = type {i32, i32, i32, i32, i32, i32, i32, i32, |
| 4 | i32, i32, i32, i32, i32, i32, i32, i32, |
| 5 | i32, i32, i32, i32, i32, i32, i32, i32 } |
Arnold Schwaighofer | 9779494 | 2007-11-10 10:48:01 +0000 | [diff] [blame] | 6 | |
Dan Gohman | bafd387 | 2008-12-03 01:10:18 +0000 | [diff] [blame] | 7 | define fastcc i32 @tailcallee(%struct.s* byval %a) nounwind { |
Arnold Schwaighofer | 9779494 | 2007-11-10 10:48:01 +0000 | [diff] [blame] | 8 | entry: |
| 9 | %tmp2 = getelementptr %struct.s* %a, i32 0, i32 0 |
| 10 | %tmp3 = load i32* %tmp2 |
| 11 | ret i32 %tmp3 |
| 12 | } |
| 13 | |
Dan Gohman | bafd387 | 2008-12-03 01:10:18 +0000 | [diff] [blame] | 14 | define fastcc i32 @tailcaller(%struct.s* byval %a) nounwind { |
Arnold Schwaighofer | 9779494 | 2007-11-10 10:48:01 +0000 | [diff] [blame] | 15 | entry: |
| 16 | %tmp4 = tail call fastcc i32 @tailcallee(%struct.s* %a byval) |
| 17 | ret i32 %tmp4 |
| 18 | } |