xref: /llvm-project/bolt/test/X86/jump-table-pic-order.test (revision 11791ae7b0b05b8bd8d806331ff51da618912cf8)
1*11791ae7SSayhaan Siddiqui## Check that successors of a basic block with jump table are generated
2*11791ae7SSayhaan Siddiqui## in the same order as they appear in the input code.
35a343994SMaksim Panchenko
45a343994SMaksim PanchenkoRUN: %clang %cflags %S/Inputs/jump-table-pic.s -o %t.exe -Wl,-q
5ab14eb23SAmir AyupovRUN: llvm-bolt %t.exe --strict --print-cfg --print-only=main -o %t.null \
65a343994SMaksim PanchenkoRUN:   | FileCheck %s
75a343994SMaksim Panchenko
85a343994SMaksim PanchenkoCHECK:      BB Layout   : {{.*, .*, .*,}} [[BB4to6:.*, .*, .*]]
95a343994SMaksim Panchenko
10*11791ae7SSayhaan Siddiqui## Check that successors appear in the order matching the input layout.
115a343994SMaksim PanchenkoCHECK:      jmpq    *%rax # JUMPTABLE
125a343994SMaksim PanchenkoCHECK-NEXT: Successors: [[BB4to6]]
13