aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/g++.dg/warn/Wswitch-1.C12
-rw-r--r--gcc/testsuite/g++.dg/warn/Wswitch-2.C8
2 files changed, 10 insertions, 10 deletions
diff --git a/gcc/testsuite/g++.dg/warn/Wswitch-1.C b/gcc/testsuite/g++.dg/warn/Wswitch-1.C
index e9fcb58..5c68b02 100644
--- a/gcc/testsuite/g++.dg/warn/Wswitch-1.C
+++ b/gcc/testsuite/g++.dg/warn/Wswitch-1.C
@@ -20,16 +20,16 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
default: break;
}
switch (ei)
- { /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" { target *-*-* } 24 } */
- } /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */
+ { /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
+ } /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" { target *-*-* } 23 } */
switch (ej)
{
default: break;
}
- switch (ek)
+ switch (ek) /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */
{
case e1: return 1;
- } /* { dg-warning "enumeration value `e2' not handled in switch" "enum e2" } */
+ }
switch (el)
{
case e1: return 1;
@@ -46,12 +46,12 @@ foo (int i, int j, enum e ei, enum e ej, enum e ek, enum e el,
case e2: return 2;
default: break;
}
- switch (eo)
+ switch (eo) /* { dg-warning "case value `3' not in enumerated type `e'" "excess 3" } */
{
case e1: return 1;
case e2: return 2;
case 3: return 3;
- } /* { dg-warning "case value `3' not in enumerated type `e'" "excess 3" } */
+ }
switch (ep)
{
case e1: return 1;
diff --git a/gcc/testsuite/g++.dg/warn/Wswitch-2.C b/gcc/testsuite/g++.dg/warn/Wswitch-2.C
index b151e23..9bc7d02 100644
--- a/gcc/testsuite/g++.dg/warn/Wswitch-2.C
+++ b/gcc/testsuite/g++.dg/warn/Wswitch-2.C
@@ -13,19 +13,19 @@ foo (enum e ei, int j)
case e3: return 2;
case e4: return 3;
} /* No warning here since e2 has the same value as e3. */
- switch (ei)
+ switch (ei) /* { dg-warning "enumeration value `e4' not handled in switch" "enum e4" } */
{
case e1: return 1;
case e2: return 2;
- } /* { dg-warning "enumeration value `e4' not handled in switch" "enum e4" } */
+ }
switch ((int) ei)
{
case e1: return 1;
} /* No warning here since switch condition was cast to int. */
- switch ((enum e) j)
+ switch ((enum e) j) /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
{
case e2: return 1;
case e4: return 2;
- } /* { dg-warning "enumeration value `e1' not handled in switch" "enum e1" } */
+ }
return 0;
}