File: unreachable.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (49 lines) | stat: -rw-r--r-- 2,018 bytes parent folder | download | duplicates (3)
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
# Check unreachable code elimination

RUN: %clang %cflags %p/../Inputs/stub.c -fPIC -pie -shared -o %t.so
RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \
RUN:   %p/Inputs/unreachable.s -o %t.o
RUN: %clangxx %cxxflags -no-pie %t.o -o %t.exe %t.so
RUN: llvm-bolt %t.exe -o %t \
RUN:   -reorder-blocks=none -split-functions -eliminate-unreachable \
RUN:   -funcs=foo -use-gnu-stack -print-cfg -print-finalized \
RUN:   | FileCheck %s --check-prefix=BOLT
RUN: llvm-objdump -d %t --print-imm-hex --disassemble-symbols=foo \
RUN:   --no-show-raw-insn | FileCheck %s

BOLT: BB Layout   : .LBB{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LLP{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .LFT{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}
BOLT: BOLT-INFO: UCE removed 4 blocks and 16 bytes of code
BOLT: BB Layout   : .LBB{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .LLP{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}, .Ltmp{{.*}}

CHECK: <foo>:
CHECK-NEXT: pushq   %rbp
CHECK-NEXT: movq    %rsp, %rbp
CHECK-NEXT: pushq   %rbx
CHECK-NEXT: subq    $0x18, %rsp
CHECK-NEXT: movq    %rdi, -0x18(%rbp)
CHECK-NEXT: incq   -0x18(%rbp)
CHECK-NEXT: incq   -0x18(%rbp)
CHECK-NEXT: cmpq   $0x2, -0x18(%rbp)
CHECK-NEXT: je    0x[[#%x,JMP1:]]
CHECK-NEXT: incq   -0x18(%rbp)
CHECK-NEXT: [[#JMP1]]: incq   -0x18(%rbp)
CHECK-NEXT: movq    -0x18(%rbp), %rax
CHECK-NEXT: movq    %rax, %rdi
CHECK-NEXT: callq {{.*}} <bar>
CHECK-NEXT: movq    %rax, %rbx
CHECK-NEXT: [[#%x,JMP3:]]: movq    %rbx, %rax
CHECK-NEXT: jmp   {{.*}}
CHECK-NEXT: movq    %rax, %rdi
CHECK-NEXT: callq {{.*}} <__cxa_begin_catch@plt>
CHECK-NEXT: incq   -0x18(%rbp)
CHECK-NEXT: incq   -0x18(%rbp)
CHECK-NEXT: cmpq   $0x2, -0x18(%rbp)
CHECK-NEXT: je    0x[[#%x,JMP2:]]
CHECK-NEXT: incq   -0x18(%rbp)
CHECK-NEXT: [[#JMP2]]: incq   -0x18(%rbp)
CHECK-NEXT: movq    -0x18(%rbp), %rbx
CHECK-NEXT: callq {{.*}} <__cxa_end_catch@plt>
CHECK-NEXT: jmp   0x[[#JMP3]]
CHECK-NEXT: movq	-0x8(%rbp), %rbx
CHECK-NEXT: leave
CHECK-NEXT: retq