From bca07a4524feb4edec581062d631a13116320a24 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 20 Feb 2011 13:06:31 +0000 Subject: Vendor import of clang trunk r126079: http://llvm.org/svn/llvm-project/cfe/trunk@126079 --- test/CodeGen/switch.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/CodeGen/switch.c') diff --git a/test/CodeGen/switch.c b/test/CodeGen/switch.c index dc2d27bc16da..8b94a0976e6e 100644 --- a/test/CodeGen/switch.c +++ b/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; + } +} -- cgit v1.3