Chandler Carruth | 93786da | 2016-12-23 00:23:01 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -O1 -disable-llvm-passes -emit-llvm -o - %s | FileCheck %s |
Hans Wennborg | 9565cf5 | 2016-06-22 16:21:14 +0000 | [diff] [blame] | 2 | |
| 3 | #define M if (x) goto L1; |
| 4 | #define M10 M M M M M M M M M M |
| 5 | #define M100 M10 M10 M10 M10 M10 M10 M10 M10 M10 M10 |
| 6 | #define M1000 M100 M100 M100 M100 M100 M100 M100 M100 M100 M100 |
| 7 | |
| 8 | void f(int x) { |
| 9 | int h; |
| 10 | |
| 11 | // Many gotos to not-yet-emitted labels would cause EHScope's FixupDepth |
| 12 | // to overflow (PR23490). |
| 13 | M1000 M1000 M1000 |
| 14 | |
| 15 | if (x == 5) { |
| 16 | // This will cause us to emit a clean-up of the stack variable. If the |
| 17 | // FixupDepths are broken, fixups will erroneously get threaded through it. |
| 18 | int i; |
| 19 | } |
| 20 | |
| 21 | L1: |
| 22 | return; |
| 23 | } |
| 24 | |
Rafael Espindola | 922f2aa | 2018-02-23 19:30:48 +0000 | [diff] [blame] | 25 | // CHECK-LABEL: define {{(dso_local )?}}void @f |
Hans Wennborg | 9565cf5 | 2016-06-22 16:21:14 +0000 | [diff] [blame] | 26 | // CHECK-NOT: cleanup |