gcc/testsuite/gdc.test/compilable/test23586.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=23586 |
| 2 | |
| 3 | int test23686a(int x) |
| 4 | { |
| 5 | switch(x) |
| 6 | { |
| 7 | case 0: |
| 8 | goto Bar; |
| 9 | |
| 10 | Bar: |
| 11 | default: |
| 12 | auto y = 6; |
| 13 | return y; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | int test23686b(int x) |
| 18 | { |
| 19 | switch(x) |
| 20 | { |
| 21 | case 0: |
| 22 | Bar: |
| 23 | case 1: |
| 24 | case 2: |
| 25 | auto y = 7; |
| 26 | return y; |
| 27 | |
| 28 | default: |
| 29 | goto Bar; |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | static assert(test23686a(0) == 6); |
| 34 | static assert(test23686b(3) == 7); |