diff options
author | Chris Lattner <sabre@nondot.org> | 2010-05-06 05:50:07 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-05-06 05:50:07 +0000 |
commit | 68784efaf62af6cc4234ea01f378e859dd7bfbab (patch) | |
tree | fafaf448dbe23158f716c4782974cd4d24a61c53 /clang/test/CodeGen/builtins.c | |
parent | 43660c5bc00e052d92c065645393d00b9ff3463d (diff) | |
download | bcm5719-llvm-68784efaf62af6cc4234ea01f378e859dd7bfbab.tar.gz bcm5719-llvm-68784efaf62af6cc4234ea01f378e859dd7bfbab.zip |
optimize builtin_isnan/isinf to not do an extraneous extension from
float -> double (which happens because they are modelled as int(...)
functions), and add a testcase for isinf.
llvm-svn: 103167
Diffstat (limited to 'clang/test/CodeGen/builtins.c')
-rw-r--r-- | clang/test/CodeGen/builtins.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins.c b/clang/test/CodeGen/builtins.c index a4424d77428..e604fbe3189 100644 --- a/clang/test/CodeGen/builtins.c +++ b/clang/test/CodeGen/builtins.c @@ -163,3 +163,21 @@ void bar() { } // CHECK: } + + +// CHECK: define void @test_inff +void test_inff(float F, double D, long double LD) { + volatile int res; + res = __builtin_isinf(F); + // CHECK: call float @fabsf(float + // CHECK: fcmp oeq float {{.*}}, 0x7FF0000000000000 + + res = __builtin_isinf(D); + // CHECK: call double @fabs(double + // CHECK: fcmp oeq double {{.*}}, 0x7FF0000000000000 + + res = __builtin_isinf(LD); + // CHECK: call x86_fp80 @fabsl(x86_fp80 + // CHECK: fcmp oeq x86_fp80 {{.*}}, 0xK7FFF8000000000000000 +} + |