diff --git a/swift/integration-tests/.gitignore b/swift/integration-tests/.gitignore index 9ea4244ad915..b613644a5ae4 100644 --- a/swift/integration-tests/.gitignore +++ b/swift/integration-tests/.gitignore @@ -7,3 +7,4 @@ DerivedData/ .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata *.actual db +*.swiftmodule diff --git a/swift/integration-tests/posix-only/frontend-invocations/F1.swift b/swift/integration-tests/posix-only/frontend-invocations/F1.swift new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/swift/integration-tests/posix-only/frontend-invocations/F2.swift b/swift/integration-tests/posix-only/frontend-invocations/F2.swift new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/swift/integration-tests/posix-only/frontend-invocations/Files.expected b/swift/integration-tests/posix-only/frontend-invocations/Files.expected index 319c1010ab4e..f13e45d89a51 100644 --- a/swift/integration-tests/posix-only/frontend-invocations/Files.expected +++ b/swift/integration-tests/posix-only/frontend-invocations/Files.expected @@ -3,4 +3,6 @@ | C.swift:0:0:0:0 | C.swift | | D.swift:0:0:0:0 | D.swift | | E.swift:0:0:0:0 | E.swift | +| F1.swift:0:0:0:0 | F1.swift | +| F2.swift:0:0:0:0 | F2.swift | | file://:0:0:0:0 | | diff --git a/swift/integration-tests/posix-only/frontend-invocations/Makefile b/swift/integration-tests/posix-only/frontend-invocations/Makefile deleted file mode 100644 index d3ddece6b9f4..000000000000 --- a/swift/integration-tests/posix-only/frontend-invocations/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -OS=$(shell uname) -ifeq ($(OS),Darwin) -SDK=-sdk $(shell xcrun -show-sdk-path) -FRONTEND=$(shell xcrun -find swift-frontend) -else -SDK="" -FRONTEND=swiftc -endif - -all: - $(FRONTEND) -frontend -c A.swift $(SDK) - $(FRONTEND) -frontend -c B.swift -o B.o $(SDK) - $(FRONTEND) -frontend -c -primary-file C.swift $(SDK) - $(FRONTEND) -frontend -c -primary-file D.swift -o D.o $(SDK) - $(FRONTEND) -frontend -c -primary-file E.swift Esup.swift -o E.o $(SDK) diff --git a/swift/integration-tests/posix-only/frontend-invocations/build.sh b/swift/integration-tests/posix-only/frontend-invocations/build.sh new file mode 100755 index 000000000000..03f1148ca05e --- /dev/null +++ b/swift/integration-tests/posix-only/frontend-invocations/build.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +if [[ "$(uname)" == Darwin ]]; then + SDK="-sdk $(xcrun -show-sdk-path)" + FRONTEND="$(xcrun -find swift-frontend)" +else + SDK="" + FRONTEND="swift-frontend" +fi + +$FRONTEND -frontend -c A.swift $SDK +$FRONTEND -frontend -c B.swift -o B.o $SDK +$FRONTEND -frontend -c -primary-file C.swift $SDK +$FRONTEND -frontend -c -primary-file D.swift -o D.o $SDK +$FRONTEND -frontend -c -primary-file E.swift Esup.swift -o E.o $SDK +$FRONTEND -frontend -emit-module -primary-file F1.swift F2.swift -module-name F -o F1.swiftmodule $SDK +$FRONTEND -frontend -emit-module F1.swift -primary-file F2.swift -module-name F -o F2.swiftmodule $SDK +$FRONTEND -merge-modules F1.swiftmodule F2.swiftmodule -o F.swiftmodule $SDK diff --git a/swift/integration-tests/posix-only/frontend-invocations/test.py b/swift/integration-tests/posix-only/frontend-invocations/test.py index b415c024e562..4aec427a4b44 100644 --- a/swift/integration-tests/posix-only/frontend-invocations/test.py +++ b/swift/integration-tests/posix-only/frontend-invocations/test.py @@ -1,5 +1,5 @@ from create_database_utils import * run_codeql_database_create([ - 'make', + './build.sh', ], lang='swift')