|
2 | 2 | # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t.o
|
3 | 3 |
|
4 | 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 |
| 5 | +# RUN: %lld -dylib -o %t %t.o \ |
| 6 | +# RUN: -segprot FOO rwx xwr \ |
| 7 | +# RUN: -segprot BAR --x --x \ |
| 8 | +# RUN: -segprot BAZ -w -w |
6 | 9 | # RUN: llvm-readobj --macho-segment %t | FileCheck %s
|
7 | 10 |
|
8 | 11 | # CHECK: Name: FOO
|
|
32 | 35 | # CHECK-NEXT: maxprot: -w-
|
33 | 36 | # CHECK-NEXT: initprot: -w-
|
34 | 37 |
|
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 |
| 38 | +# RUN: %lld -dylib -o %t.different %t.o -segprot FOO rw r |
| 39 | +# RUN: llvm-readobj --macho-segment %t.different \ |
| 40 | +# RUN: | FileCheck %s --check-prefix=DIFFERENT |
39 | 41 |
|
40 |
| -# MISMATCH: error: invalid argument '-segprot FOO rwx rw': max and init must be the same for non-i386 archs |
| 42 | +# RUN: %no-arg-lld -arch x86_64 -platform_version "mac catalyst" 14.0.0 17.5 \ |
| 43 | +# RUN: -dylib -o /dev/null %t.o -segprot FOO rw r |
| 44 | +# RUN: llvm-readobj --macho-segment %t.different \ |
| 45 | +# RUN: | FileCheck %s --check-prefix=DIFFERENT |
| 46 | + |
| 47 | +# DIFFERENT: Name: FOO |
| 48 | +# DIFFERENT-NEXT: Size: |
| 49 | +# DIFFERENT-NEXT: vmaddr: |
| 50 | +# DIFFERENT-NEXT: vmsize: |
| 51 | +# DIFFERENT-NEXT: fileoff: |
| 52 | +# DIFFERENT-NEXT: filesize: |
| 53 | +# DIFFERENT-NEXT: maxprot: rw- |
| 54 | +# DIFFERENT-NEXT: initprot: r-- |
| 55 | + |
| 56 | +# RUN: not %no-arg-lld -arch x86_64 -platform_version ios-simulator 14.0 15.0 \ |
| 57 | +# RUN: -dylib -o /dev/null %t.o -segprot FOO rwx rw 2>&1 \ |
| 58 | +# RUN: | FileCheck %s --check-prefix=MISMATCH |
| 59 | +# RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO r rw 2>&1 \ |
| 60 | +# RUN: | FileCheck %s --check-prefix=INITTOOPERMISSIVE |
| 61 | +# RUN: not %lld -dylib -o /dev/null %t.o -segprot __LINKEDIT rwx rwx 2>&1 \ |
| 62 | +# RUN: | FileCheck %s --check-prefix=NO-LINKEDIT |
| 63 | +# RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO uhh wat 2>&1 \ |
| 64 | +# RUN: | FileCheck %s --check-prefix=MISPARSE |
| 65 | +# RUN: not %lld -dylib -o /dev/null %t.o -segprot FOO rwx 2>&1 \ |
| 66 | +# RUN: | FileCheck %s --check-prefix=MISSING |
| 67 | + |
| 68 | +# MISMATCH: error: invalid argument '-segprot FOO rwx rw': max and init must be the same for non-macOS non-i386 archs |
| 69 | +# INITTOOPERMISSIVE: error: invalid argument '-segprot FOO r rw': init must not be more permissive than max |
41 | 70 | # NO-LINKEDIT: error: -segprot cannot be used to change __LINKEDIT's protections
|
42 | 71 | # MISPARSE: error: unknown -segprot letter 'u' in uhh
|
43 | 72 | # MISPARSE: error: unknown -segprot letter 'a' in wat
|
|
0 commit comments