summaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/ubsan/shift-5.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/c-c++-common/ubsan/shift-5.c')
-rw-r--r--gcc/testsuite/c-c++-common/ubsan/shift-5.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/gcc/testsuite/c-c++-common/ubsan/shift-5.c b/gcc/testsuite/c-c++-common/ubsan/shift-5.c
deleted file mode 100644
index 9e85042b059..00000000000
--- a/gcc/testsuite/c-c++-common/ubsan/shift-5.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-fsanitize=shift -w" } */
-/* { dg-shouldfail "ubsan" } */
-
-int
-foo (int x)
-{
- /* None of the following should pass. */
- switch (x)
- {
- case 1 >> -1:
-/* { dg-error "case label does not reduce to an integer constant" "" { target c } 11 } */
-/* { dg-error "is not a constant expression" "" { xfail { *-*-* } } 11 } */
- case -1 >> -1:
-/* { dg-error "case label does not reduce to an integer constant" "" { target c } 14 } */
-/* { dg-error "is not a constant expression" "" { xfail { *-*-* } } 14 } */
- case 1 << -1:
-/* { dg-error "case label does not reduce to an integer constant" "" { target c } 17 } */
-/* { dg-error "is not a constant expression" "" { xfail { *-*-* } } 17 } */
- case -1 << -1:
-/* { dg-error "case label does not reduce to an integer constant" "" { target c } 20 } */
-/* { dg-error "is not a constant expression" "" { xfail { *-*-* } } 20 } */
- return 1;
- }
- return 0;
-}
-
-int
-bar (int x)
-{
- /* None of the following should pass. */
- switch (x)
- {
- case -1 >> 200:
-/* { dg-error "case label does not reduce to an integer constant" "" { target c } 34 } */
-/* { dg-error "is not a constant expression" "" { xfail { *-*-* } } 34 } */
- case 1 << 200:
-/* { dg-error "case label does not reduce to an integer constant" "" { target c } 37 } */
-/* { dg-error "is not a constant expression" "" { xfail { *-*-* } } 37 } */
- return 1;
- }
- return 0;
-}