diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2008-07-25 01:11:38 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2008-07-25 01:11:38 +0000 |
| commit | 0e5845c13a70e429d896f032da45211a746c8267 (patch) | |
| tree | 1b47178c2cba5e4529610e7e00ec13e79f5ac4cf /clang/test/CodeGen/rdr-6098585-unsigned-caserange.c | |
| parent | dd49a04d18ef6068c7bb6763e83a351d43563d84 (diff) | |
| download | bcm5719-llvm-0e5845c13a70e429d896f032da45211a746c8267.tar.gz bcm5719-llvm-0e5845c13a70e429d896f032da45211a746c8267.zip | |
Rework codegen of case ranges
- Fix multiple issues with the way case ranges were emitted, see test
cases details about the specific issues.
- The root issue was not being careful about how basic blocks were
emitted which led to them being chained together incorrectly,
resulting in improper control flow.
- Fixes <rdar://problem/6098585>
llvm-svn: 54006
Diffstat (limited to 'clang/test/CodeGen/rdr-6098585-unsigned-caserange.c')
| -rw-r--r-- | clang/test/CodeGen/rdr-6098585-unsigned-caserange.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGen/rdr-6098585-unsigned-caserange.c b/clang/test/CodeGen/rdr-6098585-unsigned-caserange.c new file mode 100644 index 00000000000..adf825c8135 --- /dev/null +++ b/clang/test/CodeGen/rdr-6098585-unsigned-caserange.c @@ -0,0 +1,12 @@ +// RUN: clang --emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t && +// RUN: grep "ret i32" %t | count 1 && +// RUN: grep "ret i32 3" %t | count 1 + +int f2(unsigned x) { + switch(x) { + default: + return 3; + case 0xFFFFFFFF ... 1: // This range should be empty because x is unsigned. + return 0; + } +} |

