Skip to content

Commit 51f6e9a

Browse files
committed
[test] Tidy up newly-added clang_rt Driver tests to be a bit clearer
Per feedback from David U.
1 parent d11704b commit 51f6e9a

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

test/Driver/linker-clang_rt.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
// REQUIRES: OS=macosx
2-
// Note: This is really about the /host/ environment, but since there are RUN
3-
// lines for multiple targets anyway it doesn't make a huge difference.
1+
// Make sure that the platform-appropriate clang_rt library (found relative to
2+
// the compiler) is included when using Swift as a linker (with Apple targets).
43

54
// We use hard links to make sure the Swift driver really thinks it's been
65
// moved.
@@ -27,6 +26,9 @@
2726
// RUN: %t/bin/swiftc -driver-print-jobs -target i386-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix WATCHOS %s
2827
// RUN: %t/bin/swiftc -driver-print-jobs -target armv7k-apple-watchos2 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix WATCHOS %s
2928

29+
// Clean up the test executable because hard links are expensive.
30+
// RUN: rm -f %t/bin/swiftc
31+
3032
// CHECK: bin/ld{{"? }}
3133
// CHECK-NO-RUNTIME-NOT: libclang_rt
3234
// CHECK-MACOS-SAME: {{[^ ]+/lib/clang/darwin/libclang_rt.osx.a}}

validation-test/Driver/Inputs/clang_rt-helper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include <stdbool.h>
22

3-
static inline bool testNewOS() {
4-
if (__builtin_available(macOS 10.12, *)) {
3+
static inline bool isRunningOnFairlyRecentOS() {
4+
if (__builtin_available(macOS 10.12, iOS 10, tvOS 10, watchOS 3, *)) {
55
return true;
66
} else {
77
return false;

validation-test/Driver/clang_rt.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Just make sure we can build and link successfully.
66

7-
if testNewOS() {
7+
if isRunningOnFairlyRecentOS() {
88
print("new!")
99
} else {
1010
print("old...")

0 commit comments

Comments
 (0)