Skip to content

Commit a9c5d09

Browse files
committed
[ELF][test] Test identical CIE content with different personality
If we change CieRecord *&rec = cieMap[{cie.data(), personality}]; to CieRecord *&rec = cieMap[{cie.data(), nullptr}]; The new test can catch the failure.
1 parent 17df742 commit a9c5d09

File tree

1 file changed

+47
-10
lines changed

1 file changed

+47
-10
lines changed

lld/test/ELF/eh-frame-multilpe-cie.s

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,50 @@
1-
// REQUIRES: x86
2-
// RUN: llvm-mc %s -o %t.o -filetype=obj -triple=x86_64-pc-linux
3-
// RUN: ld.lld --eh-frame-hdr %t.o -o /dev/null -shared
4-
// We would fail to parse multiple cies in the same file.
1+
# REQUIRES: x86
2+
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
3+
# RUN: ld.lld --eh-frame-hdr -shared %t.o -o %t.so
4+
# RUN: llvm-dwarfdump --eh-frame %t.so | FileCheck %s
55

6-
.cfi_startproc
7-
.cfi_personality 0x9b, foo
8-
.cfi_endproc
6+
# CHECK: 00000000 00000014 00000000 CIE
7+
# CHECK: Augmentation:
8+
# CHECK-SAME: "zR"
99

10-
.cfi_startproc
11-
.cfi_endproc
10+
# CHECK: 00000018 00000014 0000001c FDE cie=00000000 {{.*}}
1211

13-
foo:
12+
# CHECK: 00000030 0000001c 00000000 CIE
13+
# CHECK: Augmentation:
14+
# CHECK-SAME: "zPR"
15+
# CHECK: Personality Address:
16+
17+
# CHECK: 00000050 00000014 00000024 FDE cie=00000030 {{.*}}
18+
19+
# CHECK: 00000068 0000001c 00000000 CIE
20+
# CHECK: Augmentation:
21+
# CHECK-SAME: "zPR"
22+
# CHECK: Personality Address:
23+
24+
# CHECK: 00000088 00000014 00000024 FDE cie=00000068 {{.*}}
25+
26+
foo0:
27+
.cfi_startproc
28+
.cfi_personality 0x9b, personality0
29+
ret
30+
.cfi_endproc
31+
32+
## This CIE cannot be merged into the previous one because the Personality is different.
33+
foo1:
34+
.cfi_startproc
35+
.cfi_personality 0x9b, personality1
36+
ret
37+
.cfi_endproc
38+
39+
bar:
40+
.cfi_startproc
41+
ret
42+
.cfi_endproc
43+
44+
.globl personality0, personality1
45+
.hidden personality0, personality1
46+
personality0:
47+
ret
48+
49+
personality1:
50+
ret

0 commit comments

Comments
 (0)