Skip to content

Commit 5a80060

Browse files
committed
SR-7309: Add tests for -static-executable on Linux
- Add extra tests using Dispatch and Foundation with -static-executable.
1 parent 3ceb61d commit 5a80060

7 files changed

+36
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Here is a partial list of tests in the repository:
3232
| test-import-glibc | Compile a source file importing and using Glibc |
3333
| test-multi-compile | Compile multiple source files into an executable |
3434
| test-multi-compile-glibc | Compile multiple source files importing Glibc into an executable |
35+
| test-static-executable | Test -static-executable on Linux with Dispatch and Foundation |
3536
| test-static-lib | Compile multiple source files into a static library |
3637
| test-xctest-package | Build a package that imports XCTest |
3738

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Dispatch
2+
3+
let queue = DispatchQueue(label: "queuename", attributes: .concurrent)
4+
queue.sync {
5+
print("Dispatch")
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
REQUIRES: platform=Linux
2+
RUN: rm -rf %t
3+
RUN: mkdir -p %t
4+
RUN: %{swiftc} -static-executable -o %t/dispatch_test %S/dispatch-static-executable.swift
5+
RUN: %t/dispatch_test | %{FileCheck} %s
6+
RUN: %{readelf} -program-headers %t/dispatch_test | %{FileCheck} %s --check-prefix=ELF
7+
CHECK: Dispatch
8+
ELF-NOT: INTERP
9+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import Foundation
2+
3+
print(URL(string: "http://apple.com")!.absoluteString)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REQUIRES: platform=Linux
2+
RUN: rm -rf %t
3+
RUN: mkdir -p %t
4+
RUN: %{swiftc} -static-executable -o %t/foundation-static_executable %S/foundation-static-executable.swift
5+
RUN: %t/foundation-static_executable | %{FileCheck} %s
6+
RUN: %{readelf} -program-headers %t/foundation-static_executable | %{FileCheck} %s --check-prefix=ELF
7+
CHECK: http://apple.com
8+
ELF-NOT: INTERP
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
print("OK")
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REQUIRES: platform=Linux
2+
RUN: rm -rf %t
3+
RUN: mkdir -p %t
4+
RUN: %{swiftc} -static-executable -o %t/static_executable %S/static-executable.swift
5+
RUN: %t/static_executable | %{FileCheck} %s
6+
RUN: %{readelf} -program-headers %t/static_executable | %{FileCheck} %s --check-prefix=ELF
7+
CHECK: OK
8+
ELF-NOT: INTERP

0 commit comments

Comments
 (0)