Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / interprocedural-ref-entry-point.s
blob0e1cca5c9bfe68133caaf2f8bfb866ac6aebea81
1 # This reproduces a bug where not registering cold fragment entry points
2 # leads to removing blocks and an inconsistent CFG after UCE.
3 # Test assembly was obtained using C-Reduce from this C++ code:
4 # (compiled with `g++ -O2 -Wl,-q`)
6 # #include <stdexcept>
7 # int a;
8 # int main() {
9 # if (a)
10 # try {
11 # throw std::logic_error("");
12 # } catch (...) {}
13 # try {
14 # throw std::logic_error("");
15 # } catch (...) {}
16 # }
18 # REQUIRES: system-linux
20 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
21 # RUN: %clangxx %cxxflags -no-pie %t.o -o %t.exe -Wl,-q
22 # RUN: llvm-bolt %t.exe -o %t.out --dump-dot-all --funcs=main.* \
23 # RUN: 2>&1 | FileCheck %s
25 # CHECK-NOT: Assertion `isValid()' failed.
27 .globl main
28 main:
29 jmp .L3 # jump to the secondary entry point in main.cold.0
31 .section a,"ax"
32 main.cold.0:
33 .cfi_startproc
34 .cfi_lsda 3,b
35 ud2
36 call __cxa_throw
37 .L3:
38 nop
39 .cfi_endproc
41 .section .gcc_except_table
43 .byte 0xff,0x3
44 .uleb128 e-c
46 .byte 1
47 .uleb128 e-d
49 .uleb128 0,0,0,0,0
50 .uleb128 .L3-main.cold.0
51 .uleb128 .L3-main.cold.0