summaryrefslogtreecommitdiff
path: root/testsuite/tests/wasm/should_run/control-flow/src/multiswitch.cmm
blob: 8b3c76aa5036bb7518e1c47eb898572f5a7e6b55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
myswitch (bits32 n) {
  switch [0 .. 4] n {
    case 0, 1: { foreign "C" A(); goto next; }
    case 2: { foreign "C" B(); goto inner; }
    case 4: { inner: foreign "C" C(); goto next; }
    default: { foreign "C" D(); goto next; }
  }
  next:
  switch [0 .. 4] n {
    case 0, 1: { foreign "C" G(); goto finish; }
    case 2: { foreign "C" H(); goto inner2; }
    case 4: { foreign "C" J(); goto finish; }
    case 3: { inner2: foreign "C" I(); 
               switch [0 .. 1] n {
                 case 0: { foreign "C" I0(); goto finish; }
                 case 1: { foreign "C" I1(); goto finish; }
               }
            }
  }
  finish: 
    return();
}