summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/cpp/if-shift.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/cpp/if-shift.c')
-rw-r--r--gcc/testsuite/gcc.dg/cpp/if-shift.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/cpp/if-shift.c b/gcc/testsuite/gcc.dg/cpp/if-shift.c
new file mode 100644
index 000000000..a55420a79
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/if-shift.c
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+
+/* Test shift operators. */
+
+#if 1 << 4 != 16
+#error /* { dg-bogus "error" "<< +ve shift" } */
+#endif
+
+#if 19 >> 2 != 4
+#error /* { dg-bogus "error" ">> +ve shift" } */
+#endif
+
+#if 17 << -2 != 17 >> 2
+#error /* { dg-bogus "error" "<< -ve shift" } */
+#endif
+
+#if 25 >> -2 != 25 << 2
+#error /* { dg-bogus "error" ">> -ve shift" } */
+#endif
+