aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/other/switch3.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/other/switch3.C')
-rw-r--r--gcc/testsuite/g++.dg/other/switch3.C25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/other/switch3.C b/gcc/testsuite/g++.dg/other/switch3.C
new file mode 100644
index 00000000000..4f9b5485ef9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/switch3.C
@@ -0,0 +1,25 @@
+// PR c++/39371
+// { dg-do compile }
+
+void
+foo (bool b)
+{
+ switch ((unsigned int) b)
+ {
+ case 1:
+ case 2:
+ break;
+ }
+}
+
+void
+bar (unsigned char b)
+{
+ switch ((unsigned int) b)
+ {
+ case 1:
+ case 257:
+ case 513:
+ break;
+ }
+}