43 lines · plain
1## Check that fixBranches() is not invoked on a broken CFG which could lead to2## unintended consequences including a firing assertion.3 4# RUN: llvm-mc --filetype=obj --triple x86_64-unknown-unknown %s -o %t.o5# RUN: link_fdata %s %t.o %t.fdata6# RUN: llvm-strip --strip-unneeded %t.o7# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q8# RUN: llvm-bolt %t.exe -o %t.bolt --split-functions --split-strategy=cdsplit \9# RUN: --data=%t.fdata --reorder-blocks=ext-tsp 2>&1 | FileCheck %s10 11# CHECK: internal call detected12 13 .text14 15 .globl foo16 .type foo, @function17foo:18 ret19 .size foo, .-foo20 21## main contains an internal call. ValidateInternalCalls pass will modify CFG22## (making it invalid) and mark the function as non-simple. After that, we23## cannot make any assumption about the CFG.24 25 .globl main26 .type main, @function27main:28 call .L129 ret30.L1:31 pushq %rbp32 movq %rsp, %rbp33 movl $1, %edi34LLmain_foo1:35 call foo36# FDATA: 1 main #LLmain_foo1# 1 foo 0 0 60037 movl $4, %edi38 xorl %eax, %eax39 popq %rbp40 retq41.Lmain_end:42 .size main, .Lmain_end-main43