]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Driver/darwin-version.c
Vendor import of clang trunk r306956:
[FreeBSD/FreeBSD.git] / test / Driver / darwin-version.c
1 // RUN: %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
2 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX %s
3 // CHECK-VERSION-OSX: "armv6k-apple-macosx10.5.0"
4 // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.0 -c %s -### 2>&1 | \
5 // RUN:   FileCheck --check-prefix=CHECK-VERSION-IOS2 %s
6 // CHECK-VERSION-IOS2: "armv6k-apple-ios2.0.0"
7 // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=2.2 -c %s -### 2>&1 | \
8 // RUN:   FileCheck --check-prefix=CHECK-VERSION-IOS22 %s
9 // CHECK-VERSION-IOS22: "armv6k-apple-ios2.2.0"
10 // RUN: %clang -target armv6-apple-darwin9 -miphoneos-version-min=3.0 -c %s -### 2>&1 | \
11 // RUN:   FileCheck --check-prefix=CHECK-VERSION-IOS3 %s
12 // CHECK-VERSION-IOS3: "armv6k-apple-ios3.0.0"
13
14 // RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \
15 // RUN:   %clang -target armv7-apple-ios9.0 -c -### %s 2> %t.err
16 // RUN:   FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS4 %s
17 // CHECK-VERSION-IOS4: invalid iOS deployment version 'IPHONEOS_DEPLOYMENT_TARGET=11.0'
18
19 // RUN: %clang -target armv7-apple-ios9.0 -miphoneos-version-min=11.0 -c -### %s 2> %t.err
20 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS5 %s
21 // CHECK-VERSION-IOS5: invalid iOS deployment version '-miphoneos-version-min=11.0'
22
23 // RUN: %clang -target i386-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2> %t.err
24 // RUN: FileCheck --input-file=%t.err --check-prefix=CHECK-VERSION-IOS6 %s
25 // CHECK-VERSION-IOS6: invalid iOS deployment version '-mios-simulator-version-min=11.0'
26
27 // RUN: %clang -target armv7-apple-ios11.1 -c -### %s 2>&1 | \
28 // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS7 %s
29 // CHECK-VERSION-IOS7: thumbv7-apple-ios10.99.99
30
31 // RUN: env IPHONEOS_DEPLOYMENT_TARGET=11.0 \
32 // RUN:   %clang -target arm64-apple-ios11.0 -c -### %s 2>&1 | \
33 // RUN:   FileCheck --check-prefix=CHECK-VERSION-IOS8 %s
34 // CHECK-VERSION-IOS8: arm64-apple-ios11.0.0
35
36 // RUN: %clang -target arm64-apple-ios11.0 -miphoneos-version-min=11.0 -c -### %s 2>&1 | \
37 // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS9 %s
38 // CHECK-VERSION-IOS9: arm64-apple-ios11.0.0
39
40 // RUN: %clang -target x86_64-apple-darwin -mios-simulator-version-min=11.0 -c -### %s 2>&1 | \
41 // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS10 %s
42 // CHECK-VERSION-IOS10: x86_64-apple-ios11.0.0
43
44 // RUN: %clang -target arm64-apple-ios11.1 -c -### %s 2>&1 | \
45 // RUN: FileCheck --check-prefix=CHECK-VERSION-IOS11 %s
46 // CHECK-VERSION-IOS11: arm64-apple-ios11.1.0
47
48 // RUN: %clang -target i686-apple-darwin8 -c %s -### 2>&1 | \
49 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX4 %s
50 // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.4 -c %s -### 2>&1 | \
51 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX4 %s
52 // CHECK-VERSION-OSX4: "i386-apple-macosx10.4.0"
53 // RUN: %clang -target i686-apple-darwin9 -c %s -### 2>&1 | \
54 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX5 %s
55 // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.5 -c %s -### 2>&1 | \
56 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX5 %s
57 // CHECK-VERSION-OSX5: "i386-apple-macosx10.5.0"
58 // RUN: %clang -target i686-apple-darwin10 -c %s -### 2>&1 | \
59 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX6 %s
60 // RUN: %clang -target i686-apple-darwin9 -mmacosx-version-min=10.6 -c %s -### 2>&1 | \
61 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX6 %s
62 // CHECK-VERSION-OSX6: "i386-apple-macosx10.6.0"
63 // RUN: %clang -target x86_64-apple-darwin14 -c %s -### 2>&1 | \
64 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
65 // RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min=10.10 -c %s -### 2>&1 | \
66 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
67 // RUN: %clang -target x86_64-apple-macosx -mmacos-version-min=10.10 -c %s -### 2>&1 | \
68 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX10 %s
69 // CHECK-VERSION-OSX10: "x86_64-apple-macosx10.10.0"
70 // RUN: %clang -target x86_64-apple-macosx -mmacosx-version-min= -c %s -### 2>&1 | \
71 // RUN:   FileCheck --check-prefix=CHECK-VERSION-MISSING %s
72 // RUN: %clang -target x86_64-apple-macosx -mmacos-version-min= -c %s -### 2>&1 | \
73 // RUN:   FileCheck --check-prefix=CHECK-VERSION-MISSING %s
74 // CHECK-VERSION-MISSING: invalid version number
75 // RUN: %clang -target armv7k-apple-darwin -mwatchos-version-min=2.0 -c %s -### 2>&1 | \
76 // RUN:   FileCheck --check-prefix=CHECK-VERSION-WATCHOS20 %s
77 // RUN: %clang -target armv7-apple-darwin -mtvos-version-min=8.3 -c %s -### 2>&1 | \
78 // RUN:   FileCheck --check-prefix=CHECK-VERSION-TVOS83 %s
79 // CHECK-VERSION-TVOS83: "thumbv7-apple-tvos8.3.0"
80 // RUN: %clang -target i386-apple-darwin -mtvos-simulator-version-min=8.3 -c %s -### 2>&1 | \
81 // RUN:   FileCheck --check-prefix=CHECK-VERSION-TVSIM83 %s
82 // CHECK-VERSION-TVSIM83: "i386-apple-tvos8.3.0"
83 // RUN: %clang -target armv7k-apple-darwin -mwatchos-version-min=2.0 -c %s -### 2>&1 | \
84 // RUN:   FileCheck --check-prefix=CHECK-VERSION-WATCHOS20 %s
85 // CHECK-VERSION-WATCHOS20: "thumbv7k-apple-watchos2.0.0"
86 // RUN: %clang -target i386-apple-darwin -mwatchos-simulator-version-min=2.0 -c %s -### 2>&1 | \
87 // RUN:   FileCheck --check-prefix=CHECK-VERSION-WATCHSIM20 %s
88 // CHECK-VERSION-WATCHSIM20: "i386-apple-watchos2.0.0"
89
90 // Check environment variable gets interpreted correctly
91 // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 IPHONEOS_DEPLOYMENT_TARGET=2.0 \
92 // RUN:   %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
93 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX5 %s
94 // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 IPHONEOS_DEPLOYMENT_TARGET=2.0 \
95 // RUN:   %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
96 // RUN:   FileCheck --check-prefix=CHECK-VERSION-IOS2 %s
97
98 // RUN: env MACOSX_DEPLOYMENT_TARGET=10.4.10 \
99 // RUN:   %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
100 // RUN:   FileCheck --check-prefix=CHECK-VERSION-OSX49 %s
101 // CHECK-VERSION-OSX49: "i386-apple-macosx10.4.10"
102 // RUN: env IPHONEOS_DEPLOYMENT_TARGET=2.3.1 \
103 // RUN:   %clang -target armv6-apple-darwin9 -c %s -### 2>&1 | \
104 // RUN:   FileCheck --check-prefix=CHECK-VERSION-IOS231 %s
105 // CHECK-VERSION-IOS231: "armv6k-apple-ios2.3.1"
106
107 // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 TVOS_DEPLOYMENT_TARGET=8.3.1 \
108 // RUN:   %clang -target armv7-apple-darwin9 -c %s -### 2>&1 | \
109 // RUN:   FileCheck --check-prefix=CHECK-VERSION-TVOS %s
110 // CHECK-VERSION-TVOS: "thumbv7-apple-tvos8.3.1"
111 // RUN: env TVOS_DEPLOYMENT_TARGET=8.3.1 \
112 // RUN:   %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
113 // RUN:   FileCheck --check-prefix=CHECK-VERSION-TVOSSIM %s
114 // CHECK-VERSION-TVOSSIM: "i386-apple-tvos8.3.1"
115
116 // RUN: env MACOSX_DEPLOYMENT_TARGET=10.5 WATCHOS_DEPLOYMENT_TARGET=2.0 \
117 // RUN:   %clang -target armv7-apple-darwin9 -c %s -### 2>&1 | \
118 // RUN:   FileCheck --check-prefix=CHECK-VERSION-WATCHOS %s
119 // CHECK-VERSION-WATCHOS: "thumbv7-apple-watchos2.0.0"
120 // RUN: env WATCHOS_DEPLOYMENT_TARGET=2.0 \
121 // RUN:   %clang -target i386-apple-darwin9 -c %s -### 2>&1 | \
122 // RUN:   FileCheck --check-prefix=CHECK-VERSION-WATCHOSSIM %s
123 // CHECK-VERSION-WATCHOSSIM: "i386-apple-watchos2.0.0"