Jakob Stoklund Olesen | 4180d48 | 2010-07-10 16:30:25 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=x86 | FileCheck %s |
Rafael Espindola | 0b3b53a | 2009-06-30 12:18:16 +0000 | [diff] [blame] | 2 | ; PR4484 |
| 3 | |
Jakob Stoklund Olesen | 4180d48 | 2010-07-10 16:30:25 +0000 | [diff] [blame] | 4 | ; ceil leaves a value on the stack that is needed after the asm. |
| 5 | ; CHECK: ceil |
| 6 | ; CHECK-NOT: fstp |
| 7 | ; Load %a from stack after ceil |
| 8 | ; CHECK: fldt |
| 9 | ; CHECK-NOT: fxch |
| 10 | ; CHECK: fistpl |
| 11 | ; CHECK-NOT: fstp |
| 12 | ; Set up call to test. |
| 13 | ; CHECK: fstpt |
| 14 | ; CHECK: test |
Rafael Espindola | 0b3b53a | 2009-06-30 12:18:16 +0000 | [diff] [blame] | 15 | define void @test2(x86_fp80 %a) { |
| 16 | entry: |
| 17 | %0 = call x86_fp80 @ceil() |
| 18 | call void asm sideeffect "fistpl $0", "{st},~{st}"(x86_fp80 %a) |
| 19 | call void @test(x86_fp80 %0) |
| 20 | ret void |
| 21 | } |
| 22 | |
Jakob Stoklund Olesen | 4180d48 | 2010-07-10 16:30:25 +0000 | [diff] [blame] | 23 | declare x86_fp80 @ceil() |
| 24 | declare void @test(x86_fp80) |