Welcome to mirror list, hosted at ThFree Co, Russian Federation.

issue26.s « X86 « test « bolt - github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a3faea8bcdee59635ffa58d1a9c9cdf7860695b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# This reproduces issue 26 from our github repo
#  BOLT fails with the following assertion:
#    llvm/tools/llvm-bolt/src/BinaryFunction.cpp:2950: void llvm::bolt::BinaryFunction::postProcessBranches(): Assertion `validateCFG() && "invalid CFG"' failed.

# REQUIRES: system-linux

# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
# RUN:   %s -o %t.o
# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q
# RUN: llvm-bolt %t.exe -relocs -print-cfg -o %t.out \
# RUN:    | FileCheck %s

# CHECK-NOT: BOLT-WARNING: CFG invalid in XYZ @ .LBB0

# CHECK: Binary Function "XYZ"

# CHECK: .Ltmp{{.*}} (1 instructions, align : 1)
# CHECK-NEXT: Secondary Entry Point: FUNCat{{.*}}

  .text
  .globl XYZ
  .type XYZ, %function
  .size XYZ, .Lend1-XYZ
XYZ:
  movl %fs:-0x350, %eax
  cmpl %eax, %edi
  jne .L1

  cmp %rdx, (%rsi)
  jne .L2

  movq %rcx, (%rsi)
.L1:
  retq

.L2:
  movl $0xffffffff, %eax
  retq
.Lend1:

  .globl FUNC
  .type FUNC, %function
  .size FUNC, .Lend - FUNC
FUNC:
  cmpq %rdi, %rsi
  je .L1
  retq
.Lend:

  .globl main
  .type main, %function
  .size main, .Lend2 - main
main:
  xorq %rax, %rax
  retq
.Lend2: