Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / invalid / eh-frame.s
blob0e51975bfa4b8a4db62f02d21692781938fa0d7e
1 # REQUIRES: x86
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)
24 #--- too-small-1.s
25 .p2align 3
26 .section __TEXT,__eh_frame
27 .short 0x3
29 .subsections_via_symbols
31 #--- too-small-2.s
32 .p2align 3
33 .section __TEXT,__eh_frame
34 .long 0x3 # length
36 .subsections_via_symbols
38 #--- personality-enc.s
39 .p2align 3
40 .section __TEXT,__eh_frame
42 .long 0x14 # length
43 .long 0 # CIE offset
44 .byte 1 # version
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
57 #--- pointer-enc.s
58 .p2align 3
59 .section __TEXT,__eh_frame
61 .long 0x14 # length
62 .long 0 # CIE offset
63 .byte 1 # version
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
74 #--- string-err.s
75 .p2align 3
76 .section __TEXT,__eh_frame
78 .long 0x7 # length
79 .long 0 # CIE offset
80 .byte 1 # version
81 .ascii "zR" # invalid aug string
83 .subsections_via_symbols