aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/rdr-6098585-fallthrough-to-empty-range.c
blob: c12cf82ba0ccec81563f55af5f12822ad1bdf377 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// RUN: clang-cc -triple i386-unknown-unknown -emit-llvm-bc -o - %s | opt -std-compile-opts | llvm-dis > %t
// RUN: grep "ret i32 %" %t

// Make sure return is not constant (if empty range is skipped or miscompiled)

int f0(unsigned x) {
  switch(x) {
  case 2:
    // fallthrough empty range
  case 10 ... 9:
    return 10;
  default:
    return 0;
  }
}