MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice17831.d
blob41abbf77a82e5f90dd4183bd04ce8b31d016aea6
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice17831.d(23): Error: `case` variables have to be `const` or `immutable`
5 fail_compilation/ice17831.d(23): Error: `case` variable `i` declared at fail_compilation/ice17831.d(21) cannot be declared in `switch` body
6 fail_compilation/ice17831.d(37): Error: `case` variables have to be `const` or `immutable`
7 fail_compilation/ice17831.d(37): Error: `case` variable `i` declared at fail_compilation/ice17831.d(35) cannot be declared in `switch` body
8 fail_compilation/ice17831.d(52): Error: `case` variables have to be `const` or `immutable`
9 fail_compilation/ice17831.d(52): Error: `case` variable `i` declared at fail_compilation/ice17831.d(49) cannot be declared in `switch` body
10 fail_compilation/ice17831.d(65): Error: `case` variables have to be `const` or `immutable`
11 fail_compilation/ice17831.d(65): Error: `case` variable `i` declared at fail_compilation/ice17831.d(64) cannot be declared in `switch` body
12 fail_compilation/ice17831.d(77): Error: `case` variables have to be `const` or `immutable`
13 fail_compilation/ice17831.d(77): Error: `case` variable `i` declared at fail_compilation/ice17831.d(76) cannot be declared in `switch` body
14 ---
17 void test17831a()
19 switch (0)
21 foreach (i; 0 .. 5)
23 case i:
24 break;
26 default:
27 break;
31 void test17831b()
33 switch (0)
35 for (int i = 0; i < 5; i++)
37 case i:
38 break;
40 default:
41 break;
45 void test17831c()
47 switch (0)
49 int i = 0;
50 while (i++ < 5)
52 case i:
53 break;
55 default:
56 break;
60 void test17831d()
62 switch (0)
64 int i = 0;
65 case i:
66 break;
67 default:
68 break;
72 void test17831e()
74 switch (0)
76 static int i = 0;
77 case i:
78 break;
79 default:
80 break;