diff options
Diffstat (limited to 'clang/test/CodeGen/switch.c')
-rw-r--r-- | clang/test/CodeGen/switch.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGen/switch.c b/clang/test/CodeGen/switch.c index dc2d27bc16d..8b94a0976e6 100644 --- a/clang/test/CodeGen/switch.c +++ b/clang/test/CodeGen/switch.c @@ -194,3 +194,20 @@ int f13(unsigned x) { return 0; } } + +// Don't delete a basic block that we want to introduce later references to. +// This isn't really specific to switches, but it's easy to show with them. +// rdar://problem/8837067 +int f14(int x) { + switch (x) { + + // case range so that the case block has no predecessors + case 0 ... 15: + // any expression which doesn't introduce a new block + (void) 0; + // kaboom + + default: + return x; + } +} |