1 ; RUN: llc -O0 -mtriple=x86_64-unknown-unknown < %s | FileCheck %s
3 ; Checks that fake uses of the FP stack do not cause a crash.
5 ; /*******************************************************************/
6 ; extern long double foo(long double, long double, long double);
8 ; long double actual(long double p1, long double p2, long double p3) {
9 ; return fmal(p1, p2, p3);
11 ; /*******************************************************************/
13 define x86_fp80 @actual(x86_fp80 %p1, x86_fp80 %p2, x86_fp80 %p3) optdebug {
18 %p1.addr = alloca x86_fp80, align 16
19 %p2.addr = alloca x86_fp80, align 16
20 %p3.addr = alloca x86_fp80, align 16
21 store x86_fp80 %p1, ptr %p1.addr, align 16
22 store x86_fp80 %p2, ptr %p2.addr, align 16
23 store x86_fp80 %p3, ptr %p3.addr, align 16
24 %0 = load x86_fp80, ptr %p1.addr, align 16
25 %1 = load x86_fp80, ptr %p2.addr, align 16
26 %2 = load x86_fp80, ptr %p3.addr, align 16
28 ; CHECK: callq{{.*}}foo
30 %3 = call x86_fp80 @foo(x86_fp80 %0, x86_fp80 %1, x86_fp80 %2)
31 %4 = load x86_fp80, ptr %p1.addr, align 16
32 call void (...) @llvm.fake.use(x86_fp80 %4)
33 %5 = load x86_fp80, ptr %p2.addr, align 16
34 call void (...) @llvm.fake.use(x86_fp80 %5)
35 %6 = load x86_fp80, ptr %p3.addr, align 16
36 call void (...) @llvm.fake.use(x86_fp80 %6)
43 declare x86_fp80 @foo(x86_fp80, x86_fp80, x86_fp80)