Skip to content

Commit 04c1e52

Browse files
committed
[MC][test] Test Mach-O __TEXT,__gcc_except_tab
This test is simplified from lld/test/MachO/compact-unwind-lsda-folding.s, which tests .uleb128 A-B where A and B are in different fragments (not tested in llvm/). `.uleb128 Lfunc_end0-Ltmp1` requires evaluateKnownAbsolute in MCAssembler::relaxLEB to be foldable.
1 parent bed9081 commit 04c1e52

File tree

2 files changed

+35
-7
lines changed

2 files changed

+35
-7
lines changed

llvm/test/MC/MachO/gcc-except-tab.s

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# RUN: llvm-mc -triple=x86_64-apple-darwin %s | FileCheck %s --check-prefix=ASM
2+
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t
3+
# RUN: llvm-objdump -s %t | FileCheck %s
4+
5+
# ASM: Lexception0:
6+
# ASM-NEXT: .uleb128 Lttbase0-Lttbaseref0
7+
8+
# CHECK: Contents of section __TEXT,__text:
9+
# CHECK-NEXT: 0000 e8000000 0090e900 000000 ...........
10+
# CHECK: Contents of section __TEXT,__gcc_except_tab:
11+
# CHECK-NEXT: 000b 020106 ...
12+
13+
.section __TEXT,__text,regular,pure_instructions
14+
Lfunc_begin0:
15+
callq ___cxa_begin_catch
16+
Ltmp1:
17+
nop
18+
jmp ___cxa_end_catch ## TAILCALL
19+
Lfunc_end0:
20+
.section __TEXT,__gcc_except_tab
21+
Lexception0:
22+
.uleb128 Lttbase0-Lttbaseref0
23+
Lttbaseref0:
24+
.uleb128 Lcst_end0-Lcst_begin0
25+
Lcst_begin0:
26+
.uleb128 Lfunc_end0-Ltmp1 ## Call between Ltmp1 and Lfunc_end0
27+
28+
Lcst_end0:
29+
Lttbase0:
30+
31+
.section __TEXT,__text,regular,pure_instructions
32+
.globl __Z1hv
33+
__Z1hv:
34+
35+
.subsections_via_symbols

llvm/test/MC/X86/macho-uleb.s

-7
This file was deleted.

0 commit comments

Comments
 (0)