Skip to content

Commit 14f0241

Browse files
committed
Add tests for -L vs -Xlinker order
1 parent ab5588d commit 14f0241

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

test/Driver/linker.swift

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@
4343
// RUN: %FileCheck %s < %t.complex.txt
4444
// RUN: %FileCheck -check-prefix COMPLEX %s < %t.complex.txt
4545

46-
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-ios7.1 -Xlinker -rpath -Xlinker customrpath %s 2>&1 > %t.simple.txt
47-
// RUN: %FileCheck -check-prefix IOS-custom-rpath %s < %t.simple.txt
46+
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-ios7.1 -Xlinker -rpath -Xlinker customrpath -L foo %s 2>&1 > %t.simple.txt
47+
// RUN: %FileCheck -check-prefix IOS-linker-order %s < %t.simple.txt
4848

49-
// RUN: %swiftc_driver -driver-print-jobs -target armv7-unknown-linux-gnueabihf -Xlinker -rpath -Xlinker customrpath %s 2>&1 > %t.linux.txt
50-
// RUN: %FileCheck -check-prefix LINUX-custom-rpath %s < %t.linux.txt
49+
// RUN: %swiftc_driver -driver-print-jobs -target armv7-unknown-linux-gnueabihf -Xlinker -rpath -Xlinker customrpath -L foo %s 2>&1 > %t.linux.txt
50+
// RUN: %FileCheck -check-prefix LINUX-linker-order %s < %t.linux.txt
5151

5252
// RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 -g %s | %FileCheck -check-prefix DEBUG %s
5353

@@ -292,21 +292,23 @@
292292
// LINUX_DYNLIB-x86_64-DAG: -L bar
293293
// LINUX_DYNLIB-x86_64: -o dynlib.out
294294

295-
// IOS-custom-rpath: swift
296-
// IOS-custom-rpath: -o [[OBJECTFILE:.*]]
295+
// IOS-linker-order: swift
296+
// IOS-linker-order: -o [[OBJECTFILE:.*]]
297297

298-
// IOS-custom-rpath: bin/ld{{"? }}
299-
// IOS-custom-rpath: -rpath [[STDLIB_PATH:[^ ]+/lib/swift/iphonesimulator]]
300-
// IOS-custom-rpath: -rpath customrpath
301-
// IOS-custom-rpath: -o {{.*}}
298+
// IOS-linker-order: bin/ld{{"? }}
299+
// IOS-linker-order: -rpath [[STDLIB_PATH:[^ ]+/lib/swift/iphonesimulator]]
300+
// IOS-linker-order: -L foo
301+
// IOS-linker-order: -rpath customrpath
302+
// IOS-linker-order: -o {{.*}}
302303

303-
// LINUX-custom-rpath: swift
304-
// LINUX-custom-rpath: -o [[OBJECTFILE:.*]]
304+
// LINUX-linker-order: swift
305+
// LINUX-linker-order: -o [[OBJECTFILE:.*]]
305306

306-
// LINUX-custom-rpath: clang++{{"? }}
307-
// LINUX-custom-rpath: -Xlinker -rpath -Xlinker {{[^ ]+/lib/swift/linux}}
308-
// LINUX-custom-rpath: -Xlinker -rpath -Xlinker customrpath
309-
// LINUX-custom-rpath: -o {{.*}}
307+
// LINUX-linker-order: clang++{{"? }}
308+
// LINUX-linker-order: -Xlinker -rpath -Xlinker {{[^ ]+/lib/swift/linux}}
309+
// LINUX-linker-order: -L foo
310+
// LINUX-linker-order: -Xlinker -rpath -Xlinker customrpath
311+
// LINUX-linker-order: -o {{.*}}
310312

311313
// DEBUG: bin/swift
312314
// DEBUG-NEXT: bin/swift

0 commit comments

Comments
 (0)