1 # REQUIRES: aarch64, x86
3 # RUN: rm -rf %t && mkdir -p %t
5 # RUN: llvm-mc -filetype=obj -triple=arm64-apple-darwin %s -o %t/test.o
6 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %s -o %t/native.o
7 # RUN: not %no-fatal-warnings-lld -arch x86_64 -lSystem %t/test.o -o /dev/null -arch_errors_fatal 2>&1 | FileCheck %s -DFILE=%t/test.o --check-prefix=CHECK-ERROR
8 # RUN: %no-fatal-warnings-lld -arch x86_64 -lSystem %t/test.o %t/native.o -o /dev/null 2>&1 | FileCheck %s -DFILE=%t/test.o --check-prefix=CHECK-WARNING
9 # RUN: %lld -arch arm64 -lSystem %t/test.o -arch_errors_fatal -o /dev/null
10 # CHECK-ERROR: error: {{.*}}[[FILE]] has architecture arm64 which is incompatible with target architecture x86_64
11 # CHECK-WARNING: warning: {{.*}}[[FILE]] has architecture arm64 which is incompatible with target architecture x86_64
13 # RUN: %lld -dylib -arch arm64 -platform_version macOS 10.14 10.15 -o %t/out.dylib %t/test.o
15 # RUN: not %no-arg-lld -dylib -arch arm64 -platform_version iOS 9.0 11.0 \
16 # RUN: %t/out.dylib -o /dev/null 2>&1 | FileCheck %s --check-prefix=DYLIB-PLAT
17 # DYLIB-PLAT: {{.*}}out.dylib has platform macOS, which is different from target platform iOS
19 # RUN: %lld -lSystem -dylib -arch arm64 -platform_version macOS 10.14.0 10.15.0 %t/out.dylib -o /dev/null
21 # RUN: %no-fatal-warnings-lld -lSystem -dylib -arch arm64 -platform_version macOS 10.13.0 10.15.0 %t/out.dylib \
22 # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=DYLIB-VERSION
23 # DYLIB-VERSION: warning: {{.*}}out.dylib has version 10.14.0, which is newer than target minimum of 10.13.0
25 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos10.15.0 %s -o %t/test_x86.o
27 # RUN: not %no-arg-lld %t/test_x86.o -lSystem -arch x86_64 -platform_version iOS 10.0 15.0 \
28 # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=OBJ-PLAT
29 # OBJ-PLAT: {{.*}}test_x86.o has platform macOS, which is different from target platform iOS
31 # RUN: %lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.15.0 10.15.0 -o /dev/null
33 # RUN: %no-fatal-warnings-lld %t/test_x86.o -lSystem -arch x86_64 -platform_version macOS 10.14.0 10.15.0 \
34 # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=OBJ-VERSION
35 # OBJ-VERSION: warning: {{.*}}test_x86.o has version 10.15.0, which is newer than target minimum of 10.14.0
37 ## Test that simulators platforms are compat with their simulatees.
38 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-ios14.0 %s -o %t/test_x86_ios.o
39 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-ios14.0-simulator %s -o %t/test_x86_ios_sim.o
41 # RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios-simulator 14.0.0 14.0.0 %t/test_x86_ios.o -o /dev/null
42 # RUN: %no-arg-lld -dylib -arch x86_64 -platform_version ios 14.0.0 14.0.0 %t/test_x86_ios_sim.o -o /dev/null
44 # RUN: not %no-arg-lld -dylib -arch x86_64 -platform_version watchos-simulator 14.0.0 14.0.0 %t/test_x86_ios.o \
45 # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=CROSS-SIM
46 # CROSS-SIM: {{.*}}test_x86_ios.o has platform iOS, which is different from target platform watchOS Simulator
47 # RUN: not %no-arg-lld -dylib -arch x86_64 -platform_version watchos-simulator 14.0.0 14.0.0 %t/test_x86_ios_sim.o \
48 # RUN: -o /dev/null 2>&1 | FileCheck %s --check-prefix=CROSS-SIM2
49 # CROSS-SIM2: {{.*}}test_x86_ios_sim.o has platform iOS Simulator, which is different from target platform watchOS Simulator