|
| 1 | +! Based on clang's darwin-version.c test with tests for ios watchos and tvos |
| 2 | +! removed |
| 3 | + |
| 4 | +! RUN: %flang -target i686-apple-darwin8 -c %s -### 2>&1 | \ |
| 5 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s |
| 6 | +! RUN: %flang -target i686-apple-darwin9 -mmacos-version-min=10.4 -c %s -### 2>&1 | \ |
| 7 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX4 %s |
| 8 | +! CHECK-VERSION-OSX4: "i686-apple-macosx10.4.0" |
| 9 | +! RUN: %flang -target i686-apple-darwin9 -c %s -### 2>&1 | \ |
| 10 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s |
| 11 | +! RUN: %flang -target i686-apple-darwin9 -mmacos-version-min=10.5 -c %s -### 2>&1 | \ |
| 12 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s |
| 13 | +! CHECK-VERSION-OSX5: "i686-apple-macosx10.5.0" |
| 14 | +! RUN: %flang -target i686-apple-darwin10 -c %s -### 2>&1 | \ |
| 15 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX6 %s |
| 16 | +! RUN: %flang -target i686-apple-darwin9 -mmacos-version-min=10.6 -c %s -### 2>&1 | \ |
| 17 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX6 %s |
| 18 | +! CHECK-VERSION-OSX6: "i686-apple-macosx10.6.0" |
| 19 | +! RUN: %flang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \ |
| 20 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s |
| 21 | +! RUN: %flang -target x86_64-apple-darwin -mmacos-version-min=10.10 -c %s -### 2>&1 | \ |
| 22 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s |
| 23 | +! RUN: %flang -target x86_64-apple-darwin -mmacos-version-min=10.10 -c %s -### 2>&1 | \ |
| 24 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX10 %s |
| 25 | +! CHECK-VERSION-OSX10: "x86_64-apple-macosx10.10.0" |
| 26 | +! RUN: not %flang -target x86_64-apple-darwin -mmacos-version-min= -c %s -### 2>&1 | \ |
| 27 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-MISSING %s |
| 28 | +! RUN: not %flang -target x86_64-apple-darwin -mmacos-version-min= -c %s -### 2>&1 | \ |
| 29 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-MISSING %s |
| 30 | +! CHECK-VERSION-MISSING: missing version number |
| 31 | + |
| 32 | +! RUN: %flang -target x86_64-apple-driverkit19.0 -c %s -### 2>&1 | \ |
| 33 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-DRIVERKIT190 %s |
| 34 | +! CHECK-VERSION-DRIVERKIT190: "x86_64-apple-driverkit19.0.0" |
| 35 | + |
| 36 | +! Check environment variable gets interpreted correctly |
| 37 | +! RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 IPHONEOS_DEPLOYMENT_TARGET=2.0 \ |
| 38 | +! RUN: %flang -target i686-apple-darwin9 -c %s -### 2>&1 | \ |
| 39 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX5 %s |
| 40 | + |
| 41 | +! RUN: env MACOSX_DEPLOYMENT_TARGET=10.4.10 \ |
| 42 | +! RUN: %flang -target i386-apple-darwin9 -c %s -### 2>&1 | \ |
| 43 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-OSX49 %s |
| 44 | +! CHECK-VERSION-OSX49: "i386-apple-macosx10.4.10" |
| 45 | +! RUN: env IPHONEOS_DEPLOYMENT_TARGET=2.3.1 \ |
| 46 | +
|
| 47 | +! Target can specify the OS version: |
| 48 | + |
| 49 | +! RUN: %flang -target x86_64-apple-macos10.11.2 -c %s -### 2>&1 | \ |
| 50 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-TMAC2 %s |
| 51 | +! CHECK-VERSION-TMAC2: "x86_64-apple-macosx10.11.2" |
| 52 | + |
| 53 | +! Warn about -m<os>-version-min when it's used with target: |
| 54 | + |
| 55 | +! RUN: %flang -target x86_64-apple-macos10.11.2 -mmacos-version-min=10.6 -c %s -### 2>&1 | \ |
| 56 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-OSV1 %s |
| 57 | +! CHECK-VERSION-TNO-OSV1: overriding '-mmacos-version-min=10.6' option with '-target x86_64-apple-macos10.11.2' |
| 58 | + |
| 59 | +! RUN: %flang -target x86_64-apple-macos10.6 -mmacos-version-min=10.6 -c %s -### 2>&1 | \ |
| 60 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-TNO-SAME %s |
| 61 | +! CHECK-VERSION-TNO-SAME-NOT: overriding |
| 62 | +! CHECK-VERSION-TNO-SAME-NOT: argument unused during compilation |
| 63 | + |
| 64 | +! Target with OS version is not overridden by -m<os>-version-min variables: |
| 65 | + |
| 66 | +! RUN: %flang -target x86_64-apple-macos10.11.2 -mmacos-version-min=10.6 -c %s -### 2>&1 | \ |
| 67 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-OSV1 %s |
| 68 | +! CHECK-VERSION-TIGNORE-OSV1: "x86_64-apple-macosx10.11.2" |
| 69 | + |
| 70 | +! Target without OS version includes the OS given by -m<os>-version-min arguments: |
| 71 | + |
| 72 | +! RUN: %flang -target x86_64-apple-macos -mmacos-version-min=10.11 -c %s -### 2>&1 | \ |
| 73 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-USE-OS-ARG1 %s |
| 74 | +! CHECK-VERSION-USE-OS-ARG1: "x86_64-apple-macosx10.11.0" |
| 75 | + |
| 76 | +! Target with OS version is not overridden by environment variables: |
| 77 | + |
| 78 | +! RUN: env MACOSX_DEPLOYMENT_TARGET=10.1 \ |
| 79 | +! RUN: %flang -target i386-apple-macos10.5 -c %s -### 2>&1 | \ |
| 80 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-TMACOS-CMD %s |
| 81 | +! CHECK-VERSION-TMACOS-CMD: "i386-apple-macosx10.5.0" |
| 82 | + |
| 83 | +! Target with OS version is not overridden by arch: |
| 84 | + |
| 85 | +! RUN: %flang -target uknown-apple-macos10.11.2 -c %s -### 2>&1 | \ |
| 86 | +! RUN: FileCheck --check-prefix=CHECK-VERSION-TIGNORE-ARCH1 %s |
| 87 | +! CHECK-VERSION-TIGNORE-ARCH1: "unknown-apple-macosx10.11.2" |
| 88 | + |
| 89 | +! Target can be used to specify the environment: |
| 90 | + |
| 91 | +! RUN: %flang -target x86_64-apple-macos11 -c %s -### 2>&1 | \ |
| 92 | +! RUN: FileCheck --check-prefix=CHECK-MACOS11 %s |
| 93 | +! RUN: %flang -target x86_64-apple-darwin20 -c %s -### 2>&1 | \ |
| 94 | +! RUN: FileCheck --check-prefix=CHECK-MACOS11 %s |
| 95 | +! RUN: %flang -target x86_64-apple-darwin -mmacos-version-min=11 -c %s -### 2>&1 | \ |
| 96 | +! RUN: FileCheck --check-prefix=CHECK-MACOS11 %s |
| 97 | +! CHECK-MACOS11: "x86_64-apple-macosx11.0.0" |
| 98 | + |
| 99 | +! RUN: %flang -target arm64-apple-macosx10.16 -c %s -### 2>&1 | \ |
| 100 | +! RUN: FileCheck --check-prefix=CHECK-IMPLICIT-MACOS11 %s |
| 101 | +! CHECK-IMPLICIT-MACOS11: warning: overriding deployment version |
| 102 | +! CHECK-IMPLICIT-MACOS11: "arm64-apple-macosx11.0.0" |
| 103 | + |
| 104 | +! RUN: %flang -target arm64-apple-macos999 -c %s -### 2>&1 | \ |
| 105 | +! RUN: FileCheck --check-prefix=CHECK-MACOS999 %s |
| 106 | + |
| 107 | +! CHECK-MACOS999: "arm64-apple-macosx999.0.0" |
0 commit comments