teak-llvm/clang/test/Driver/target-triple-deployment.c
Steven Wu dfaeda6520 [Driver][Darwin] Use Host Triple to infer target os version
Summary:
When clang required to infer target os version from --target option and
the os version is not specified in targets, check the host triple. If the
host and target are both macOS, use host triple to infer target os
version.

rdar://problem/41651999

Reviewers: arphaman, dexonsmith

Reviewed By: arphaman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D48849

llvm-svn: 336168
2018-07-03 04:15:49 +00:00

42 lines
1.3 KiB
C

// RUN: touch %t.o
// RUN: %clang -target x86_64-apple-macosx10.4 -### %t.o 2> %t.log
// RUN: %clang -target x86_64-apple-darwin9 -### %t.o 2>> %t.log
// RUN: %clang -target x86_64-apple-macosx10.7 -### %t.o 2>> %t.log
//
// RUN: %clang -target armv7-apple-ios -### %t.o 2>> %t.log
// RUN: %clang -target armv7-apple-ios0.0 -### %t.o 2>> %t.log
// RUN: %clang -target armv7-apple-ios1.2.3 -### %t.o 2>> %t.log
// RUN: %clang -target armv7-apple-ios5.0 -### %t.o 2>> %t.log
// RUN: %clang -target armv7-apple-ios7.0 -### %t.o 2>> %t.log
// RUN: %clang -target arm64-apple-ios -### %t.o 2>> %t.log
//
// RUN: FileCheck %s < %t.log
// CHECK: {{ld(.exe)?"}}
// CHECK: -macosx_version_min
// CHECK: 10.4.0
// CHECK: {{ld(.exe)?"}}
// CHECK: -macosx_version_min
// CHECK: 10.5.0
// CHECK: {{ld(.exe)?"}}
// CHECK: -macosx_version_min
// CHECK: 10.7.0
// CHECK: {{ld(.exe)?"}}
// CHECK: -iphoneos_version_min
// CHECK: 5.0.0
// CHECK: {{ld(.exe)?"}}
// CHECK: -iphoneos_version_min
// CHECK: 5.0.0
// CHECK: {{ld(.exe)?"}}
// CHECK: -iphoneos_version_min
// CHECK: 1.2.3
// CHECK: {{ld(.exe)?"}}
// CHECK: -iphoneos_version_min
// CHECK: 5.0.0
// CHECK: {{ld(.exe)?"}}
// CHECK: -iphoneos_version_min
// CHECK: 7.0.0
// CHECK: {{ld(.exe)?"}}
// CHECK: -iphoneos_version_min
// CHECK: 7.0.0