]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
This commit was manufactured by cvs2svn to create branch
authorNo Author <no-author@gcc.gnu.org>
Sat, 25 Jan 2003 16:02:11 +0000 (16:02 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sat, 25 Jan 2003 16:02:11 +0000 (16:02 +0000)
'gcc-3_2-branch'.

From-SVN: r61777

gcc/testsuite/gcc.c-torture/execute/20030125-1.c [new file with mode: 0644]

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 (file)
index 0000000..318974a
--- /dev/null
@@ -0,0 +1,61 @@
+/* Verify wehther 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);
+}
+float
+q2(double a)
+{
+       return floor(a);
+}
+main()
+{
+#ifdef __OPTIMIZE__
+       if (t(0)!=0)
+               abort ();
+       if (q(0)!=0)
+               abort ();
+       if (q1(0)!=0)
+               abort ();
+       if (q2(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;
+}