summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.c-torture/compile/20081203-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.c-torture/compile/20081203-1.c')
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20081203-1.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.c-torture/compile/20081203-1.c b/gcc/testsuite/gcc.c-torture/compile/20081203-1.c
new file mode 100644
index 00000000000..713235ff50f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20081203-1.c
@@ -0,0 +1,24 @@
+/* PR rtl-optimization/38281 */
+/* Reporter: John Regehr <regehr@cs.utah.edu> */
+/* Testcase by Jakub Jelinek <jakub@redhat.com> */
+
+inline unsigned short
+foo (unsigned short x, unsigned short y)
+{
+ if (y == 0)
+ return x;
+ return x / y;
+}
+
+unsigned short a, b, c;
+
+extern int baz (int, int);
+
+void
+bar (void)
+{
+ int d = 0x3D75D162;
+ a = foo (b > d, baz (0, 1));
+ for (c = 0; c; c = 1)
+ ;
+}