gcc/testsuite/gdc.test/fail_compilation/b16967.d
raw| 1 | /* |
| 2 | * TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/b16967.d(15): Error: switch case fallthrough - use 'goto default;' if intended |
| 5 | fail_compilation/b16967.d(25): Error: switch case fallthrough - use 'goto default;' if intended |
| 6 | --- |
| 7 | */ |
| 8 | int foo(int x) |
| 9 | in |
| 10 | { |
| 11 | switch (x) |
| 12 | { |
| 13 | case 1: |
| 14 | assert(x != 0); |
| 15 | default: |
| 16 | break; |
| 17 | } |
| 18 | } |
| 19 | out(v) |
| 20 | { |
| 21 | switch(v) |
| 22 | { |
| 23 | case 42: |
| 24 | assert(x != 0); |
| 25 | default: |
| 26 | break; |
| 27 | } |
| 28 | } |
| 29 | do |
| 30 | { |
| 31 | return 42; |
| 32 | } |