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
12 # CHECK-NEXT: fileoff:
13 # CHECK-NEXT: filesize:
14 # CHECK-NEXT: maxprot: rwx
15 # CHECK-NEXT: initprot: rwx
21 # CHECK-NEXT: fileoff:
22 # CHECK-NEXT: filesize:
23 # CHECK-NEXT: maxprot: --x
24 # CHECK-NEXT: initprot: --x
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