1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: not --crash llc -mtriple=amdgcn -run-pass=legalizer -o /dev/null %s 2>&1 | FileCheck %s
4 # CHECK: LLVM ERROR: unable to legalize instruction: %3:_(p0) = G_JUMP_TABLE %jump-table.0 (in function: jt_test)
6 # FIXME: This could probably be smaller, but the jump table MIR parsing is very crashy.
9 define i32 @jt_test(i32 %x) {
11 switch i32 %x, label %return [
22 sw.bb: ; preds = %entry, %entry, %entry, %entry, %entry
23 %add = add nsw i32 %x, 42
26 sw.bb1: ; preds = %entry, %entry, %entry
27 %mul = mul nsw i32 %x, 3
30 return: ; preds = %sw.bb1, %sw.bb, %entry
31 %retval.0 = phi i32 [ %mul, %sw.bb1 ], [ %add, %sw.bb ], [ 0, %entry ]
38 tracksRegLiveness: true
43 blocks: [ '%bb.3', '%bb.3', '%bb.3', '%bb.4', '%bb.4', '%bb.4',
44 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
45 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
46 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
47 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
48 '%bb.2', '%bb.2', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
49 '%bb.2', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
50 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
51 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.2', '%bb.4',
52 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
53 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4',
54 '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.4', '%bb.2' ]
59 %0:_(s32) = COPY $sgpr0
60 %1:_(s32) = G_CONSTANT i32 0
61 %2:_(s1) = G_ICMP intpred(ugt), %0, %1
62 %3:_(p0) = G_JUMP_TABLE %jump-table.0
67 successors: %bb.3(0x2aaaaaab), %bb.4(0x2aaaaaab), %bb.2(0x2aaaaaab)