aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/pr30951.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/pr30951.c')
-rw-r--r--gcc/testsuite/gcc.dg/pr30951.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/pr30951.c b/gcc/testsuite/gcc.dg/pr30951.c
new file mode 100644
index 00000000000..149b8ecaafd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr30951.c
@@ -0,0 +1,36 @@
+/* { dg-do link } */
+
+extern void link_error (void);
+
+void test (int x, unsigned int y)
+{
+ if (x + 5 == x)
+ link_error ();
+ if (x == x + 10)
+ link_error ();
+ if (y + 5 == y)
+ link_error ();
+ if (y == y + 10)
+ link_error ();
+ if (x + 5 != x)
+ ;
+ else
+ link_error ();
+ if (x != x + 10)
+ ;
+ else
+ link_error ();
+ if (y + 5 != y)
+ ;
+ else
+ link_error ();
+ if (y != y + 10)
+ ;
+ else
+ link_error ();
+}
+
+int main()
+{
+ return 0;
+}