brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.0 KiB · ae71f3a Raw
115 lines · yaml
1# REQUIRES: x862# RUN: rm -rf %t; mkdir %t3# RUN: yaml2obj %s > %t/test.dylib4# RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15 -o %t/test_macos.o5# RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios13.15.0-macabi -o %t/test_maccatalyst.o6# RUN: echo "" | llvm-mc -filetype=obj -triple=x86_64-apple-ios13.15.0 -o %t/test_ios.o7 8## Test linking against a zippered dylib.9# RUN: %lld -lSystem -dylib %t/test.dylib %t/test_macos.o -o /dev/null10# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o /dev/null11 12# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version mac-catalyst 13.15.0 14.0 %t/test_maccatalyst.o -o /dev/null -framework MacOnly-Indirect13 14# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version mac-catalyst 13.15.0 14.0 %t/test_maccatalyst.o -o /dev/null -framework MacOnly 2>&1 | FileCheck --check-prefix=INCOMPATIBLE %s15# INCOMPATIBLE: System/Library/Frameworks{{[\\/]}}MacOnly.framework{{[\\/]}}MacOnly.tbd(MacOnly.dylib) is incompatible with x86_64 (macCatalyst13.15.0)16 17# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version ios 13.15.0 14.0 %t/test.dylib %t/test_ios.o -o /dev/null 2>&1 | FileCheck %s18# CHECK: test.dylib has platform macOS/macCatalyst, which is different from target platform iOS19 20## Test creating a zippered dylib.21# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version macos 12.0 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_macos.o -o %t/test_zippered.dylib22# RUN: llvm-otool -l %t/test_zippered.dylib | FileCheck --check-prefix=ZIPPERED %s23# ZIPPERED:           cmd LC_BUILD_VERSION24# ZIPPERED-NEXT:  cmdsize25# ZIPPERED-NEXT: platform 126# ZIPPERED-NEXT:      sdk 13.027# ZIPPERED-NEXT:    minos 12.028# ZIPPERED-NEXT:   ntools 129# ZIPPERED-NEXT:     tool30# ZIPPERED-NEXT:  version31# ZIPPERED-NEXT: Load command32# ZIPPERED-NEXT:      cmd LC_BUILD_VERSION33# ZIPPERED-NEXT:  cmdsize34# ZIPPERED-NEXT: platform 635# ZIPPERED-NEXT:      sdk 14.036# ZIPPERED-NEXT:    minos 13.1537# ZIPPERED-NEXT:   ntools 138# ZIPPERED-NEXT:     tool39# ZIPPERED-NEXT:  version40 41# RUN: %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version macos 10.8 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_macos.o -o %t/test_zippered.dylib42# RUN: llvm-otool -l %t/test_zippered.dylib | FileCheck --check-prefix=ZIPPERED-OLD %s43# ZIPPERED-OLD:           cmd LC_VERSION_MIN_MACOSX44# ZIPPERED-OLD-NEXT:  cmdsize45# ZIPPERED-OLD-NEXT:  version 10.846# ZIPPERED-OLD-NEXT:      sdk 13.047# ZIPPERED-OLD-NEXT: Load command48# ZIPPERED-OLD-NEXT:      cmd LC_BUILD_VERSION49# ZIPPERED-OLD-NEXT:  cmdsize50# ZIPPERED-OLD-NEXT: platform 651# ZIPPERED-OLD-NEXT:      sdk 14.052# ZIPPERED-OLD-NEXT:    minos 13.1553# ZIPPERED-OLD-NEXT:   ntools 154# ZIPPERED-OLD-NEXT:     tool55# ZIPPERED-OLD-NEXT:  version56 57# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -arch x86_64 -platform_version macos 10.8 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_macos.o -o %t/test_zippered.dylib 2>&1 | FileCheck --check-prefix=ZIPPERED-EXE %s58# ZIPPERED-EXE: writing zippered outputs only valid for -dylib and -bundle59 60## Reject .o files which only have the secondary platform.61# RUN: not %no-arg-lld -syslibroot %S/Inputs/MacOSX.sdk -lSystem -dylib -arch x86_64 -platform_version macos 12.0 13.0 -platform_version mac-catalyst 13.15.0 14.0 %t/test.dylib %t/test_maccatalyst.o -o %t/test_zippered.dylib 2>&1 | FileCheck --check-prefix=CAT %s62# CAT: test_maccatalyst.o has platform macCatalyst, which is different from target platform macOS63 64--- !mach-o65FileHeader:66  magic:           0xFEEDFACF67  cputype:         0x100000768  cpusubtype:      0x369  filetype:        0x670  ncmds:           471  sizeofcmds:      60072  flags:           0x10008573  reserved:        0x074LoadCommands:75  - cmd:             LC_ID_DYLIB76    cmdsize:         3277    dylib:78      name:            2479      timestamp:       180      current_version: 081      compatibility_version: 082    Content:         test83    ZeroPadBytes:    484  - cmd:             LC_DYLD_INFO_ONLY85    cmdsize:         4886    rebase_off:      087    rebase_size:     088    bind_off:        089    bind_size:       090    weak_bind_off:   091    weak_bind_size:  092    lazy_bind_off:   093    lazy_bind_size:  094    export_off:      095    export_size:     096  - cmd:             LC_BUILD_VERSION97    cmdsize:         3298    platform:        199    minos:           659200100    sdk:             720896101    ntools:          1102    Tools:103      - tool:            3104        version:         39913472105  - cmd:             LC_BUILD_VERSION106    cmdsize:         32107    platform:        6108    minos:           855808109    sdk:             917504110    ntools:          1111    Tools:112      - tool:            3113        version:         39913472114...115