aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/switch.c
blob: 690c11e9f36cab50b6397ba9d9afac360b368c72 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: clang %s -emit-llvm | llvm-as | opt -std-compile-opts -disable-output

int foo(int i) {
  int j = 0;
  switch (i) {
  case 1 : 
    j = 2; break;
  case 2:
    j = 3; break;
  default:
    j = 42; break;
  }
  j = j + 1;
  return j;
}