[llvm-commits] [dragonegg] r167461 - in /dragonegg/trunk: src/Convert.cpp test/validator/c/iceil.c
Duncan Sands
baldrick at free.fr
Tue Nov 6 07:22:36 PST 2012
Author: baldrick
Date: Tue Nov 6 09:22:36 2012
New Revision: 167461
URL: http://llvm.org/viewvc/llvm-project?rev=167461&view=rev
Log:
Add support for the iceil builtin (new in gcc-4.7) fixing PR14270.
Added:
dragonegg/trunk/test/validator/c/iceil.c
Modified:
dragonegg/trunk/src/Convert.cpp
Modified: dragonegg/trunk/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Convert.cpp?rev=167461&r1=167460&r2=167461&view=diff
==============================================================================
--- dragonegg/trunk/src/Convert.cpp (original)
+++ dragonegg/trunk/src/Convert.cpp Tue Nov 6 09:22:36 2012
@@ -4494,6 +4494,11 @@
Result);
return true;
}
+#if (GCC_MINOR > 6)
+ case BUILT_IN_ICEIL:
+ case BUILT_IN_ICEILF:
+ case BUILT_IN_ICEILL:
+#endif
case BUILT_IN_LCEIL:
case BUILT_IN_LCEILF:
case BUILT_IN_LCEILL:
@@ -4502,6 +4507,11 @@
case BUILT_IN_LLCEILL:
Result = EmitBuiltinLCEIL(stmt);
return true;
+#if (GCC_MINOR > 6)
+ case BUILT_IN_IFLOOR:
+ case BUILT_IN_IFLOORF:
+ case BUILT_IN_IFLOORL:
+#endif
case BUILT_IN_LFLOOR:
case BUILT_IN_LFLOORF:
case BUILT_IN_LFLOORL:
Added: dragonegg/trunk/test/validator/c/iceil.c
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/test/validator/c/iceil.c?rev=167461&view=auto
==============================================================================
--- dragonegg/trunk/test/validator/c/iceil.c (added)
+++ dragonegg/trunk/test/validator/c/iceil.c Tue Nov 6 09:22:36 2012
@@ -0,0 +1,14 @@
+// RUN: %dragonegg -S %s -o - -O2 -lm -ffast-math | FileCheck %s
+// PR14270
+
+// CHECK-NOT: builtin
+
+#include <math.h>
+
+int iceilf (float a) { return (int) ceil (a); }
+int iceil (double a) { return (int) ceil (a); }
+int iceill (long double a) { return (int) ceil (a); }
+
+int ifloorf (float a) { return (int) floor (a); }
+int ifloor (double a) { return (int) floor (a); }
+int ifloorl (long double a) { return (int) floor (a); }
More information about the llvm-commits
mailing list