brintos

brintos / llvm-project-archived public Read only

0
0
Text · 923 B · 474d7b8 Raw
32 lines · plain
1; RUN: opt < %s -passes=instcombine -S | FileCheck %s2 3declare double @acos(double) willreturn4 5; Check that functions without any function attributes are simplified.6 7define double @test_simplify_acos() {8; CHECK-LABEL: @test_simplify_acos9  %pi = call double @acos(double -1.000000e+00)10; CHECK-NOT: call double @acos11; CHECK: ret double 0x400921FB54442D1812  ret double %pi13}14 15; Check that we don't constant fold builtin functions.16 17define double @test_acos_nobuiltin() {18; CHECK-LABEL: @test_acos_nobuiltin19  %pi = call double @acos(double -1.000000e+00) nobuiltin 20; CHECK: call double @acos(double -1.000000e+00)21  ret double %pi22}23 24; Check that we don't constant fold strictfp results that require rounding.25 26define double @test_acos_strictfp() strictfp {27; CHECK-LABEL: @test_acos_strictfp28  %pi = call double @acos(double -1.000000e+00) strictfp 29; CHECK: call double @acos(double -1.000000e+00)30  ret double %pi31}32