]> 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, 27 Nov 2004 16:59:16 +0000 (16:59 +0000)
committerNo Author <no-author@gcc.gnu.org>
Sat, 27 Nov 2004 16:59:16 +0000 (16:59 +0000)
'gcc-3_3-branch'.

From-SVN: r91382

gcc/testsuite/g++.dg/warn/Winline-4.C [new file with mode: 0644]
gcc/testsuite/gcc.dg/20030204-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/loop-6.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/pr9771-1.c [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/warn/Winline-4.C b/gcc/testsuite/g++.dg/warn/Winline-4.C
new file mode 100644 (file)
index 0000000..188ab5a
--- /dev/null
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-O2 -Winline" }
+// Origin: <markus at oberhumer dot com>
+// PR 17115: We should not emit -Winline warning for functions marked with
+//  noinline
+
+struct Foo {
+  __attribute__((noinline)) int a(int r) { return r & 1; }
+  virtual __attribute__((noinline)) int b(int r) { return r & 1; }
+  static  __attribute__((noinline)) int c(int r) { return r & 1; }
+};
+
+int bar(int r) {
+  Foo f;
+  int k = 1; k &= f.a(r); k &= f.b(r); k &= f.a(r);
+  return k;
+}
diff --git a/gcc/testsuite/gcc.dg/20030204-1.c b/gcc/testsuite/gcc.dg/20030204-1.c
new file mode 100644 (file)
index 0000000..33a9eb2
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR optimization/8555 */
+/* { dg-do compile } */
+/* { dg-options "-O -ffast-math -funroll-loops" } */
+/* { dg-options "-march=pentium3 -O -ffast-math -funroll-loops" { target i?86-*-* } } */
+/* { dg-skip-if "" { i?86-*-* } { "-m64" } { "" } } */
+
+float foo (float *a, int i)
+{
+  int j;
+  float x = a[j = i - 1], y;
+
+  for (j = i; --j >= 0; )
+    if ((y = a[j]) > x)
+      x = y;
+
+  return x;
+}
diff --git a/gcc/testsuite/gcc.dg/loop-6.c b/gcc/testsuite/gcc.dg/loop-6.c
new file mode 100644 (file)
index 0000000..653854e
--- /dev/null
@@ -0,0 +1,25 @@
+/* PR optimization/18577 */
+/* Origin: Falk Hueffner <falk@debian.org> */
+
+/* { dg-do run } */
+/* { dg-options "-O2 -funroll-all-loops" } */
+
+static float tfcos12[3];
+__attribute__((noinline)) double f(double x) { return x; }
+int g;
+
+int main(void)
+{
+  int i, j;
+  for (i = 0; i < 1; i++) 
+    tfcos12[i] = 0.5;
+    
+  for (i = 0; i < 1; i++)
+    {
+      tfcos12[i] = 0.5 * f(i);
+      for (j = 0; j < 12; j++)
+       g++;
+    }
+
+  return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pr9771-1.c b/gcc/testsuite/gcc.dg/pr9771-1.c
new file mode 100644 (file)
index 0000000..1e3bc03
--- /dev/null
@@ -0,0 +1,43 @@
+/* PR rtl-optimization/9771 */
+/* { dg-do run { target i?86-*-* } } */
+/* { dg-options "-O2 -fomit-frame-pointer -ffixed-ebp" } */
+
+extern void abort(void);
+extern void exit(int);
+
+register long *B asm ("ebp");
+
+long x = 10;
+long y = 20;
+
+void bar(void)
+{
+  B = &y;
+}
+
+void foo()
+{
+  long *adr = B;
+  long save = *adr;
+
+  *adr = 123;
+
+  bar();
+
+  *adr = save;
+}
+
+int main()
+{
+  B = &x;
+
+  foo();
+
+  if (x != 10 || y != 20)
+    abort();
+
+  /* We can't return, as our caller may assume %ebp is preserved!  */
+  /* We could save/restore it (like foo), but its easier to exit.  */
+  exit(0);
+}
+