1 # This test case reproduces a bug where, during register swapping,
2 # the code fragments associated with the function need to be swapped
3 # together (which may be generated during PGO optimization). If not
4 # handled properly, optimized binary execution can result in a segmentation fault.
6 # REQUIRES: system-linux
8 # RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
9 # RUN: link_fdata %s %t.o %t.fdata
10 # RUN: llvm-strip --strip-unneeded %t.o
11 # RUN: %clang -no-pie %t.o -o %t.exe -Wl,-q
12 # RUN: llvm-bolt %t.exe -o %t.out -data=%t.fdata --reg-reassign | FileCheck %s
15 # CHECK: BOLT-INFO: Reg Reassignment Pass Stats
16 # CHECK-NEXT: 2 functions affected.
22 .type main.cold,@function
35 .cfi_def_cfa_offset 16
58 # FDATA: 1 main.cold #bb2# 1 main #bb4# 0 100
59 # FDATA: 1 main #bb5# 1 main #bb6# 0 100
60 # FDATA: 1 main #bb3# 1 main.cold 0 0 100
63 .size main, .Lfunc_end0-main