2 # RUN: rm -rf %t; split-file %s %t
4 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 %t/too-small-1.s -o %t/too-small-1.o
5 # RUN: not %lld -lSystem -dylib %t/too-small-1.o -o /dev/null 2>&1 | FileCheck %s --check-prefix TOO-SMALL-1
6 # TOO-SMALL-1: error: {{.*}}too-small-1.o:(__eh_frame+0x0): CIE/FDE too small
8 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 %t/too-small-2.s -o %t/too-small-2.o
9 # RUN: not %lld -lSystem -dylib %t/too-small-2.o -o /dev/null 2>&1 | FileCheck %s --check-prefix TOO-SMALL-2
10 # TOO-SMALL-2: error: {{.*}}too-small-2.o:(__eh_frame+0x0): CIE/FDE extends past the end of the section
12 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 %t/personality-enc.s -o %t/personality-enc.o
13 # RUN: not %lld -lSystem -dylib %t/personality-enc.o -o /dev/null 2>&1 | FileCheck %s --check-prefix PERS-ENC
14 # PERS-ENC: error: {{.*}}personality-enc.o:(__eh_frame+0x12): unexpected personality encoding 0xb
16 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 %t/pointer-enc.s -o %t/pointer-enc.o
17 # RUN: not %lld -lSystem -dylib %t/pointer-enc.o -o /dev/null 2>&1 | FileCheck %s --check-prefix PTR-ENC
18 # PTR-ENC: error: {{.*}}pointer-enc.o:(__eh_frame+0x11): unexpected pointer encoding 0x12
20 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 %t/string-err.s -o %t/string-err.o
21 # RUN: not %lld -lSystem -dylib %t/string-err.o -o /dev/null 2>&1 | FileCheck %s --check-prefix STR
22 # STR: error: {{.*}}string-err.o:(__eh_frame+0x9): corrupted CIE (failed to read string)
26 .section __TEXT,__eh_frame
29 .subsections_via_symbols
33 .section __TEXT,__eh_frame
36 .subsections_via_symbols
38 #--- personality-enc.s
40 .section __TEXT,__eh_frame
45 .asciz "zPR" # aug string
46 .byte 0x01 # code alignment
47 .byte 0x78 # data alignment
48 .byte 0x10 # return address register
49 .byte 0x01 # aug length
50 .byte 0x0b # personality encoding
51 .long 0xffff # personality pointer
52 .byte 0x10 # pointer encoding
53 .space 1 # pad to alignment
55 .subsections_via_symbols
59 .section __TEXT,__eh_frame
64 .asciz "zR" # aug string
65 .byte 0x01 # code alignment
66 .byte 0x78 # data alignment
67 .byte 0x10 # return address register
68 .byte 0x01 # aug length
69 .byte 0x12 # pointer encoding
70 .space 7 # pad to alignment
72 .subsections_via_symbols
76 .section __TEXT,__eh_frame
81 .ascii "zR" # invalid aug string
83 .subsections_via_symbols