Eric Christopher | aeac10e | 2011-08-20 00:17:18 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -emit-llvm %s -o - |
| 2 | |
| 3 | |
| 4 | void doesntThrow() throw(); |
| 5 | struct F { |
| 6 | ~F() { doesntThrow(); } |
| 7 | }; |
| 8 | |
| 9 | void atest() { |
| 10 | F A; |
| 11 | lab: |
| 12 | F B; |
| 13 | goto lab; |
| 14 | } |
| 15 | |
| 16 | void test(int val) { |
| 17 | label: { |
| 18 | F A; |
| 19 | F B; |
| 20 | if (val == 0) goto label; |
| 21 | if (val == 1) goto label; |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | void test3(int val) { |
| 26 | label: { |
| 27 | F A; |
| 28 | F B; |
| 29 | if (val == 0) { doesntThrow(); goto label; } |
| 30 | if (val == 1) { doesntThrow(); goto label; } |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | void test4(int val) { |
| 35 | label: { |
| 36 | F A; |
| 37 | F B; |
| 38 | if (val == 0) { F C; goto label; } |
| 39 | if (val == 1) { F D; goto label; } |
| 40 | } |
| 41 | } |