xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/switch-case-folding-2.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple i386-unknown-unknown -emit-llvm %s -o - | FileCheck %s
2*f4a2713aSLionel Sambuc // CHECK that we don't crash.
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc extern int printf(const char*, ...);
test(int val)5*f4a2713aSLionel Sambuc int test(int val){
6*f4a2713aSLionel Sambuc  switch (val) {
7*f4a2713aSLionel Sambuc  case 4:
8*f4a2713aSLionel Sambuc    do {
9*f4a2713aSLionel Sambuc      switch (6) {
10*f4a2713aSLionel Sambuc        case 6: do { case 5: printf("bad\n"); } while (0);
11*f4a2713aSLionel Sambuc      };
12*f4a2713aSLionel Sambuc    } while (0);
13*f4a2713aSLionel Sambuc  }
14*f4a2713aSLionel Sambuc  return 0;
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc 
main(void)17*f4a2713aSLionel Sambuc int main(void) {
18*f4a2713aSLionel Sambuc  return test(5);
19*f4a2713aSLionel Sambuc }
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc // CHECK: call i32 (i8*, ...)* @_Z6printfPKcz
22