53 lines · plain
1## This reproduces a bug where not registering cold fragment entry points2## 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`)5#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# }17 18# REQUIRES: system-linux19 20# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o21# RUN: %clangxx %cxxflags -no-pie %t.o -o %t.exe -Wl,-q22# RUN: llvm-bolt %t.exe -o %t.out --dump-dot-all --funcs=main.* \23# RUN: 2>&1 | FileCheck %s24#25# CHECK-NOT: Assertion `isValid()' failed.26 27 .globl main28main:29 jmp .L3 # jump to the secondary entry point in main.cold.030 31 .section a,"ax"32main.cold.0:33 .cfi_startproc34 .cfi_lsda 3,b35 ud236 call __cxa_throw37.L3:38 nop39 .cfi_endproc40 41 .section .gcc_except_table42b:43 .byte 0xff,0x344 .uleb128 e-c45c:46 .byte 147 .uleb128 e-d48d:49 .uleb128 0,0,0,0,050 .uleb128 .L3-main.cold.051 .uleb128 .L3-main.cold.052e:53