From c7c42acbf50a8edc227a6509e03aefa3543c9fc9 Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Aug 2022 12:02:40 +0200 Subject: [PATCH 1/2] Swift: port frontend-invocations test to linux `swift-frontend` will be in `$PATH` on Linux, and apparently it does not require the `-sdk` option. --- .../osx-only/frontend-invocations/Makefile | 10 ---------- .../frontend-invocations/A.swift | 0 .../frontend-invocations/B.swift | 0 .../frontend-invocations/C.swift | 0 .../frontend-invocations/D.swift | 0 .../frontend-invocations/E.swift | 0 .../frontend-invocations/Esup.swift | 0 .../frontend-invocations/Files.expected | 0 .../frontend-invocations/Files.ql | 0 .../posix-only/frontend-invocations/Makefile | 15 +++++++++++++++ .../frontend-invocations/test.py | 0 11 files changed, 15 insertions(+), 10 deletions(-) delete mode 100644 swift/integration-tests/osx-only/frontend-invocations/Makefile rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/A.swift (100%) rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/B.swift (100%) rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/C.swift (100%) rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/D.swift (100%) rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/E.swift (100%) rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/Esup.swift (100%) rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/Files.expected (100%) rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/Files.ql (100%) create mode 100644 swift/integration-tests/posix-only/frontend-invocations/Makefile rename swift/integration-tests/{osx-only => posix-only}/frontend-invocations/test.py (100%) diff --git a/swift/integration-tests/osx-only/frontend-invocations/Makefile b/swift/integration-tests/osx-only/frontend-invocations/Makefile deleted file mode 100644 index a05c5f1e9f8..00000000000 --- a/swift/integration-tests/osx-only/frontend-invocations/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -# TODO: Add linux -SDK=$(shell xcrun -show-sdk-path) -FRONTEND=$(shell xcrun -find swift-frontend) - -all: - $(FRONTEND) -frontend -c A.swift -sdk $(SDK) - $(FRONTEND) -frontend -c B.swift -o B.o -sdk $(SDK) - $(FRONTEND) -frontend -c -primary-file C.swift -sdk $(SDK) - $(FRONTEND) -frontend -c -primary-file D.swift -o D.o -sdk $(SDK) - $(FRONTEND) -frontend -c -primary-file E.swift Esup.swift -o E.o -sdk $(SDK) diff --git a/swift/integration-tests/osx-only/frontend-invocations/A.swift b/swift/integration-tests/posix-only/frontend-invocations/A.swift similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/A.swift rename to swift/integration-tests/posix-only/frontend-invocations/A.swift diff --git a/swift/integration-tests/osx-only/frontend-invocations/B.swift b/swift/integration-tests/posix-only/frontend-invocations/B.swift similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/B.swift rename to swift/integration-tests/posix-only/frontend-invocations/B.swift diff --git a/swift/integration-tests/osx-only/frontend-invocations/C.swift b/swift/integration-tests/posix-only/frontend-invocations/C.swift similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/C.swift rename to swift/integration-tests/posix-only/frontend-invocations/C.swift diff --git a/swift/integration-tests/osx-only/frontend-invocations/D.swift b/swift/integration-tests/posix-only/frontend-invocations/D.swift similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/D.swift rename to swift/integration-tests/posix-only/frontend-invocations/D.swift diff --git a/swift/integration-tests/osx-only/frontend-invocations/E.swift b/swift/integration-tests/posix-only/frontend-invocations/E.swift similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/E.swift rename to swift/integration-tests/posix-only/frontend-invocations/E.swift diff --git a/swift/integration-tests/osx-only/frontend-invocations/Esup.swift b/swift/integration-tests/posix-only/frontend-invocations/Esup.swift similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/Esup.swift rename to swift/integration-tests/posix-only/frontend-invocations/Esup.swift diff --git a/swift/integration-tests/osx-only/frontend-invocations/Files.expected b/swift/integration-tests/posix-only/frontend-invocations/Files.expected similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/Files.expected rename to swift/integration-tests/posix-only/frontend-invocations/Files.expected diff --git a/swift/integration-tests/osx-only/frontend-invocations/Files.ql b/swift/integration-tests/posix-only/frontend-invocations/Files.ql similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/Files.ql rename to swift/integration-tests/posix-only/frontend-invocations/Files.ql diff --git a/swift/integration-tests/posix-only/frontend-invocations/Makefile b/swift/integration-tests/posix-only/frontend-invocations/Makefile new file mode 100644 index 00000000000..cc516a7f425 --- /dev/null +++ b/swift/integration-tests/posix-only/frontend-invocations/Makefile @@ -0,0 +1,15 @@ +OS=$(shell uname) +ifeq ($(OS),Darwin) +SDK=-sdk $(shell xcrun -show-sdk-path) +FRONTEND=$(shell xcrun -find swift-frontend) +else +SDK="" +FRONTEND=swift-frontend +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/osx-only/frontend-invocations/test.py b/swift/integration-tests/posix-only/frontend-invocations/test.py similarity index 100% rename from swift/integration-tests/osx-only/frontend-invocations/test.py rename to swift/integration-tests/posix-only/frontend-invocations/test.py From ced36ffc61fb878757a8bc40e2da3747d3a9c1fa Mon Sep 17 00:00:00 2001 From: Paolo Tranquilli Date: Fri, 26 Aug 2022 12:12:21 +0200 Subject: [PATCH 2/2] Swift: run swift instead of swift-frontend on Linux --- .../integration-tests/posix-only/frontend-invocations/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swift/integration-tests/posix-only/frontend-invocations/Makefile b/swift/integration-tests/posix-only/frontend-invocations/Makefile index cc516a7f425..d3ddece6b9f 100644 --- a/swift/integration-tests/posix-only/frontend-invocations/Makefile +++ b/swift/integration-tests/posix-only/frontend-invocations/Makefile @@ -4,7 +4,7 @@ SDK=-sdk $(shell xcrun -show-sdk-path) FRONTEND=$(shell xcrun -find swift-frontend) else SDK="" -FRONTEND=swift-frontend +FRONTEND=swiftc endif all: