summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/execute/20030125-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20030125-1.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/execute/20030125-1.c b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
new file mode 100644
index 000000000..8eb9a4211
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20030125-1.c
@@ -0,0 +1,54 @@
+/* Verify whether math functions are simplified. */
+double sin(double);
+double floor(double);
+float
+t(float a)
+{
+ return sin(a);
+}
+float
+q(float a)
+{
+ return floor(a);
+}
+double
+q1(float a)
+{
+ return floor(a);
+}
+main()
+{
+#ifdef __OPTIMIZE__
+ if (t(0)!=0)
+ abort ();
+ if (q(0)!=0)
+ abort ();
+ if (q1(0)!=0)
+ abort ();
+#endif
+ return 0;
+}
+__attribute__ ((noinline))
+double
+floor(double a)
+{
+ abort ();
+}
+__attribute__ ((noinline))
+float
+floorf(float a)
+{
+ return a;
+}
+__attribute__ ((noinline))
+double
+sin(double a)
+{
+ abort ();
+}
+__attribute__ ((noinline))
+float
+sinf(float a)
+{
+ return a;
+}