brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.2 KiB · e87e3fa Raw
87 lines · plain
1# REQUIRES: x862# RUN: rm -rf %t; split-file %s %t3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o4# RUN: touch %t/empty.s; llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/empty.s -o %t/empty.o5 6# Check that `-allowable_client` generates LC_SUB_CLIENT.7# We create our .dylib in a `lib` subdirectory to make sure we test linking against the `.dylib` instead of the `.tbd` below.8# RUN: mkdir -p %t/lib; %lld -dylib -o %t/lib/liballowable_client.dylib %t/empty.o -allowable_client allowed -allowable_client also_allowed9# RUN: llvm-objdump --macho --all-headers %t/lib/liballowable_client.dylib | FileCheck %s10# CHECK:      LC_SUB_CLIENT11# CHECK-NEXT: cmdsize 2412# CHECK-NEXT: client allowed13# CHECK:      LC_SUB_CLIENT14# CHECK-NEXT: cmdsize 3215# CHECK-NEXT: client also_allowed16 17# Check linking against the .dylib we created above18# RUN: not %lld -o %t/test %t/test.o -L%t/lib -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT19# RUN: not %lld -o %t/libtest_debug.exe %t/test.o -L%t/lib -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT20# RUN: not %lld -o %t/test %t/test.o -L%t/lib -lallowable_client -client_name notallowed 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-EXPLICIT21# RUN: %lld -o %t/test %t/test.o -L%t/lib -lallowable_client -client_name allowed22# RUN: %lld -o %t/test %t/test.o -L%t/lib -lallowable_client -client_name all23# RUN: %lld -o %t/all %t/test.o -L%t/lib -lallowable_client24# RUN: %lld -o %t/allowed %t/test.o -L%t/lib -lallowable_client25# RUN: %lld -o %t/liballowed_debug.exe %t/test.o -L%t/lib -lallowable_client26 27# Check linking against a .tbd28# RUN: not %lld -o %t/test %t/test.o -L%t -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT29# RUN: not %lld -o %t/libtest_debug.exe %t/test.o -L%t -lallowable_client 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-IMPLICIT30# RUN: not %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name notallowed 2>&1 | FileCheck %s --check-prefix=NOTALLOWED-EXPLICIT31# RUN: %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name allowed32# RUN: %lld -o %t/test %t/test.o -L%t -lallowable_client -client_name all33# RUN: %lld -o %t/all %t/test.o -L%t -lallowable_client34# RUN: %lld -o %t/allowed %t/test.o -L%t -lallowable_client35# RUN: %lld -o %t/liballowed_debug.exe %t/test.o -L%t -lallowable_client36 37# NOTALLOWED-IMPLICIT: error: cannot link directly with 'liballowable_client.dylib' because test is not an allowed client38# NOTALLOWED-EXPLICIT: error: cannot link directly with 'liballowable_client.dylib' because notallowed is not an allowed client39 40#--- test.s41.text42.globl _main43_main:44  ret45 46#--- liballowable_client.tbd47{48  "main_library": {49    "allowable_clients": [50      {51        "clients": [52          "allowed"53        ]54      }55    ],56    "compatibility_versions": [57      {58        "version": "0"59      }60    ],61    "current_versions": [62      {63        "version": "0"64      }65    ],66    "flags": [67      {68        "attributes": [69          "not_app_extension_safe"70        ]71      }72    ],73    "install_names": [74      {75        "name": "lib/liballowable_client.dylib"76      }77    ],78    "target_info": [79      {80        "min_deployment": "10.11",81        "target": "x86_64-macos"82      }83    ]84  },85  "tapi_tbd_version": 586}87