Skip to content

Commit 408c38f

Browse files
committed
Add test for static-stdlib
This test validates the arguments passed to the linker when statically linking the swift standard library. Currently in order to ensure that no -rpath is passed, we're using FileCheck's -implicit-check-not flag, and strictly validating the order of the arguments. The order doesn't really matter here but is required for that flag to validate that no -rpath is passed.
1 parent 6073126 commit 408c38f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/Driver/linker.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// RUN: %FileCheck %s < %t.simple.txt
33
// RUN: %FileCheck -check-prefix SIMPLE %s < %t.simple.txt
44

5+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 -static-stdlib %s 2>&1 > %t.simple.txt
6+
// RUN: %FileCheck -check-prefix SIMPLE_STATIC -implicit-check-not -rpath %s < %t.simple.txt
7+
58
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-ios7.1 %s 2>&1 > %t.simple.txt
69
// RUN: %FileCheck -check-prefix IOS_SIMPLE %s < %t.simple.txt
710

@@ -69,6 +72,23 @@
6972
// SIMPLE: -o linker
7073

7174

75+
// SIMPLE_STATIC: swift
76+
// SIMPLE_STATIC: -o [[OBJECTFILE:.*]]
77+
78+
// SIMPLE_STATIC-NEXT: bin/ld{{"? }}
79+
// SIMPLE_STATIC: [[OBJECTFILE]]
80+
// SIMPLE_STATIC: -lobjc
81+
// SIMPLE_STATIC: -lSystem
82+
// SIMPLE_STATIC: -arch x86_64
83+
// SIMPLE_STATIC: -L [[STDLIB_PATH:[^ ]+/lib/swift_static/macosx]]
84+
// SIMPLE_STATIC: -lc++
85+
// SIMPLE_STATIC: -framework Foundation
86+
// SIMPLE_STATIC: -force_load_swift_libs
87+
// SIMPLE_STATIC: -macosx_version_min 10.{{[0-9]+}}.{{[0-9]+}}
88+
// SIMPLE_STATIC: -no_objc_category_merging
89+
// SIMPLE_STATIC: -o linker
90+
91+
7292
// IOS_SIMPLE: swift
7393
// IOS_SIMPLE: -o [[OBJECTFILE:.*]]
7494

0 commit comments

Comments
 (0)