Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lld / test / MachO / segprot.s
bloba4e91d13361050d517e766342e9939ae8d8ea4bc
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
4 ## Make sure the option parser doesn't think --x and -w are flags.
5 # RUN: %lld -dylib -o %t %t.o -segprot FOO rwx xwr -segprot BAR --x --x -segprot BAZ -w -w
6 # RUN: llvm-readobj --macho-segment %t | FileCheck %s
8 # CHECK: Name: FOO
9 # CHECK-NEXT: Size:
10 # CHECK-NEXT: vmaddr:
11 # CHECK-NEXT: vmsize:
12 # CHECK-NEXT: fileoff:
13 # CHECK-NEXT: filesize:
14 # CHECK-NEXT: maxprot: rwx
15 # CHECK-NEXT: initprot: rwx
17 # CHECK: Name: BAR
18 # CHECK-NEXT: Size:
19 # CHECK-NEXT: vmaddr:
20 # CHECK-NEXT: vmsize:
21 # CHECK-NEXT: fileoff:
22 # CHECK-NEXT: filesize:
23 # CHECK-NEXT: maxprot: --x
24 # CHECK-NEXT: initprot: --x
26 # CHECK: Name: BAZ
27 # CHECK-NEXT: Size:
28 # CHECK-NEXT: vmaddr:
29 # CHECK-NEXT: vmsize:
30 # CHECK-NEXT: fileoff:
31 # CHECK-NEXT: filesize:
32 # CHECK-NEXT: maxprot: -w-
33 # CHECK-NEXT: initprot: -w-
35 # RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO rwx rw 2>&1 | FileCheck %s --check-prefix=MISMATCH
36 # RUN: not %lld -dylib -o /dev/null %t.o -segprot __LINKEDIT rwx rwx 2>&1 | FileCheck %s --check-prefix=NO-LINKEDIT
37 # RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO uhh wat 2>&1 | FileCheck %s --check-prefix=MISPARSE
38 # RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO rwx 2>&1 | FileCheck %s --check-prefix=MISSING
40 # MISMATCH: error: invalid argument '-segprot FOO rwx rw': max and init must be the same for non-i386 archs
41 # NO-LINKEDIT: error: -segprot cannot be used to change __LINKEDIT's protections
42 # MISPARSE: error: unknown -segprot letter 'u' in uhh
43 # MISPARSE: error: unknown -segprot letter 'a' in wat
44 # MISSING: error: -segprot: missing argument
46 .section FOO,foo
47 .section BAR,bar
48 .section BAZ,baz