OSDN Git Service

* gcc.dg/tree-ssa/builtin-expect-1.c: New test.
authornemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Sep 2007 19:56:39 +0000 (19:56 +0000)
committernemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 5 Sep 2007 19:56:39 +0000 (19:56 +0000)
* gcc.dg/tree-ssa/builtin-expect-2.c: New test.
* gcc.dg/tree-ssa/builtin-expect-3.c: New test.
* gcc.dg/tree-ssa/builtin-expect-4.c: New test.
* gcc.dg/tree-ssa/builtin-expect-5.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128148 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-4.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c [new file with mode: 0644]

index 242a363..aeaad72 100644 (file)
@@ -1,3 +1,11 @@
+2007-09-05  Adam Nemet  <anemet@caviumnetworks.com>
+
+       * gcc.dg/tree-ssa/builtin-expect-1.c: New test.
+       * gcc.dg/tree-ssa/builtin-expect-2.c: New test.
+       * gcc.dg/tree-ssa/builtin-expect-3.c: New test.
+       * gcc.dg/tree-ssa/builtin-expect-4.c: New test.
+       * gcc.dg/tree-ssa/builtin-expect-5.c: New test.
+
 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/30302
 2007-09-05  Paolo Carlini  <pcarlini@suse.de>
 
        PR c++/30302
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-1.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-1.c
new file mode 100644 (file)
index 0000000..42d4b0d
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j) 
+{ 
+  if (__builtin_expect (i > 0 && j, 0)) 
+    g ();
+} 
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-2.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-2.c
new file mode 100644 (file)
index 0000000..ff175b9
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j) 
+{ 
+  if (__builtin_expect (i > 0 || j, 0))
+    ;
+  else
+    g ();
+} 
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-3.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-3.c
new file mode 100644 (file)
index 0000000..8fcc4e2
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j) 
+{ 
+  if (__builtin_expect (i > 0 && j, 0))
+    a ();
+  else
+    b ();
+} 
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-4.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-4.c
new file mode 100644 (file)
index 0000000..1fecf1b
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-gimple" } */
+
+f (int i, float j) 
+{ 
+  if (__builtin_expect (i > 0 || j, 0))
+    a ();
+  else
+    b ();
+} 
+
+/* { dg-final { scan-tree-dump-times {builtin_expect[^\n]*, 0\);\n[^\n]*if} 2 "gimple"} } */
+/* { dg-final { cleanup-tree-dump "gimple" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c b/gcc/testsuite/gcc.dg/tree-ssa/builtin-expect-5.c
new file mode 100644 (file)
index 0000000..ed53b28
--- /dev/null
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-forwprop" } */
+
+f (int i, float j) 
+{ 
+  if (__builtin_expect (i > 0 && __builtin_expect (j != 0, 1), 0))
+    a ();
+  else
+    b ();
+} 
+
+/* { dg-final { scan-tree-dump-times { if } 2 "forwprop1"} } */
+/* { dg-final { scan-tree-dump {builtin_expect[^\n]*, 0\);\n[^\n]*if} "forwprop1"} } */
+/* { dg-final { scan-tree-dump {builtin_expect[^\n]*, 1\);\n[^\n]*if} "forwprop1"} } */
+/* { dg-final { cleanup-tree-dump "forwprop?" } } */