gcc/testsuite/gdc.test/fail_compilation/fail11653.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail11653.d(18): Error: switch case fallthrough - use 'goto case;' if intended |
| 5 | fail_compilation/fail11653.d(23): Error: switch case fallthrough - use 'goto default;' if intended |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | void main() |
| 10 | { |
| 11 | int test = 12412; |
| 12 | int output = 0; |
| 13 | switch(test) |
| 14 | { |
| 15 | case 1: |
| 16 | output = 1; |
| 17 | //break; //Oops.. |
| 18 | case 2: .. case 3: |
| 19 | output = 2; |
| 20 | break; |
| 21 | case 4: |
| 22 | output = 3; |
| 23 | default: |
| 24 | output = 4; |
| 25 | } |
| 26 | } |