From f71f6207b5b48f0b414ff5aacf7f8373deec8542 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Wed, 30 Oct 2019 17:55:28 -0700 Subject: [PATCH 1/9] [CMake] Make swift-frontend the primary Swift binary. Build swift-frontend as the primary Swift binary, and have swift/swiftc/etc. symlink over to it. This is a step toward allowing swift-driver to replace the swift and swiftc binaries. --- stdlib/cmake/modules/SwiftSource.cmake | 2 +- test/Driver/advanced_output_file_map.swift | 16 +++---- test/Driver/basic_output_file_map.swift | 6 +-- test/Driver/batch_mode_aux_file_order.swift | 6 +-- .../batch_mode_parseable_output-fine.swift | 20 ++++----- test/Driver/bindings.swift | 22 ++++----- test/Driver/bridging-pch.swift | 20 ++++----- test/Driver/embed-bitcode.swift | 16 +++---- test/Driver/emit-interface.swift | 10 ++--- test/Driver/emit-objc-header.swift | 6 +-- test/Driver/merge-module.swift | 32 ++++++------- test/Driver/modulewrap.swift | 6 +-- test/Driver/options.swift | 4 +- test/Driver/parseable_output.swift | 8 ++-- test/Driver/parseable_output_unicode.swift | 8 ++-- test/Driver/response-file.swift | 2 +- test/Driver/subcommands.swift | 2 +- test/Driver/vfs.swift | 4 +- test/Index/Store/driver-index.swift | 2 +- tools/driver/CMakeLists.txt | 45 +++++++++++-------- 20 files changed, 123 insertions(+), 114 deletions(-) diff --git a/stdlib/cmake/modules/SwiftSource.cmake b/stdlib/cmake/modules/SwiftSource.cmake index 48fadc5a55004..f2fd7c491223e 100644 --- a/stdlib/cmake/modules/SwiftSource.cmake +++ b/stdlib/cmake/modules/SwiftSource.cmake @@ -583,7 +583,7 @@ function(_compile_swift_files set(swift_compiler_tool_dep) if(SWIFT_INCLUDE_TOOLS) # Depend on the binary itself, in addition to the symlink. - set(swift_compiler_tool_dep "swift") + set(swift_compiler_tool_dep "swift-frontend") endif() # If there are more than one output files, we assume that they are specified diff --git a/test/Driver/advanced_output_file_map.swift b/test/Driver/advanced_output_file_map.swift index 98d9d21175745..798c5cc4f0e32 100644 --- a/test/Driver/advanced_output_file_map.swift +++ b/test/Driver/advanced_output_file_map.swift @@ -36,10 +36,10 @@ // RUN: test ! -e %t/d/lib.d -// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/advanced_output_file_map.swift"], output: {object: "./obj/advanced_output_file_map.o", dependencies: "./d/advanced_output_file_map.d", swiftmodule: "./swiftmodule/advanced_output_file_map.swiftmodule", swiftdoc: "./swiftmodule/advanced_output_file_map_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}advanced_output_file_map.swiftsourceinfo", diagnostics: "./dia/advanced_output_file_map.dia"} -// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/Inputs/main.swift"], output: {object: "./obj/main.o", dependencies: "./d/main.d", swiftmodule: "./swiftmodule/main.swiftmodule", swiftdoc: "./swiftmodule/main_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}main.swiftsourceinfo", diagnostics: "./dia/main.dia"} -// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/Inputs/lib.swift"], output: {object: "./obj/lib.o", dependencies: "./d/lib.d", swiftmodule: "./swiftmodule/lib.swiftmodule", swiftdoc: "./swiftmodule/lib_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}lib.swiftsourceinfo", diagnostics: "./dia/lib.dia"} -// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["./obj/advanced_output_file_map.o", "./obj/main.o", "./obj/lib.o"], output: {swiftmodule: "./OutputFileMap.swiftmodule", swiftdoc: ".{{[/\\]}}OutputFileMap.swiftdoc", swiftsourceinfo: ".{{[/\\]}}OutputFileMap.swiftsourceinfo"} +// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/advanced_output_file_map.swift"], output: {object: "./obj/advanced_output_file_map.o", dependencies: "./d/advanced_output_file_map.d", swiftmodule: "./swiftmodule/advanced_output_file_map.swiftmodule", swiftdoc: "./swiftmodule/advanced_output_file_map_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}advanced_output_file_map.swiftsourceinfo", diagnostics: "./dia/advanced_output_file_map.dia"} +// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/Inputs/main.swift"], output: {object: "./obj/main.o", dependencies: "./d/main.d", swiftmodule: "./swiftmodule/main.swiftmodule", swiftdoc: "./swiftmodule/main_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}main.swiftsourceinfo", diagnostics: "./dia/main.dia"} +// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/Inputs/lib.swift"], output: {object: "./obj/lib.o", dependencies: "./d/lib.d", swiftmodule: "./swiftmodule/lib.swiftmodule", swiftdoc: "./swiftmodule/lib_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}lib.swiftsourceinfo", diagnostics: "./dia/lib.dia"} +// BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["./obj/advanced_output_file_map.o", "./obj/main.o", "./obj/lib.o"], output: {swiftmodule: "./OutputFileMap.swiftmodule", swiftdoc: ".{{[/\\]}}OutputFileMap.swiftdoc", swiftsourceinfo: ".{{[/\\]}}OutputFileMap.swiftsourceinfo"} // BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "ld{{(.exe)?}}", inputs: ["./obj/advanced_output_file_map.o", "./obj/main.o", "./obj/lib.o", "./OutputFileMap.swiftmodule"], output: {image: "./advanced_output_file_map.out"} // BINDINGS-DIS: # "x86_64-apple-macosx10.9" - "dsymutil{{(\.exe)?}}", inputs: ["./advanced_output_file_map.out"], output: {dSYM: "./advanced_output_file_map.out.dSYM"} @@ -75,10 +75,10 @@ // RUN: test -e %t/d/lib.d -a ! -s %t/d/lib.d -// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/advanced_output_file_map.swift"], output: {object: "./obj/advanced_output_file_map.o", dependencies: "./d/advanced_output_file_map.d", swiftmodule: "./swiftmodule/advanced_output_file_map.swiftmodule", swiftdoc: "./swiftmodule/advanced_output_file_map_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}advanced_output_file_map.swiftsourceinfo", diagnostics: "./dia/advanced_output_file_map.dia"} -// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/Inputs/main.swift"], output: {object: "./obj/main.o", swiftmodule: "./swiftmodule/main.swiftmodule", swiftdoc: "./swiftmodule/main_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}main.swiftsourceinfo", diagnostics: "./dia/main.dia"} -// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/Inputs/lib.swift"], output: {object: "./obj/lib.o", swiftmodule: "./swiftmodule/lib.swiftmodule", swiftdoc: "./swiftmodule/lib_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}lib.swiftsourceinfo", diagnostics: "./dia/lib.dia"} -// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["./obj/advanced_output_file_map.o", "./obj/main.o", "./obj/lib.o"], output: {swiftmodule: "./OutputFileMap.swiftmodule", swiftdoc: ".{{[/\\]}}OutputFileMap.swiftdoc", swiftsourceinfo: ".{{[/\\]}}OutputFileMap.swiftsourceinfo"} +// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/advanced_output_file_map.swift"], output: {object: "./obj/advanced_output_file_map.o", dependencies: "./d/advanced_output_file_map.d", swiftmodule: "./swiftmodule/advanced_output_file_map.swiftmodule", swiftdoc: "./swiftmodule/advanced_output_file_map_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}advanced_output_file_map.swiftsourceinfo", diagnostics: "./dia/advanced_output_file_map.dia"} +// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/Inputs/main.swift"], output: {object: "./obj/main.o", swiftmodule: "./swiftmodule/main.swiftmodule", swiftdoc: "./swiftmodule/main_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}main.swiftsourceinfo", diagnostics: "./dia/main.dia"} +// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/Inputs/lib.swift"], output: {object: "./obj/lib.o", swiftmodule: "./swiftmodule/lib.swiftmodule", swiftdoc: "./swiftmodule/lib_x.swiftdoc", swiftsourceinfo: "./swiftmodule{{[/\\]}}lib.swiftsourceinfo", diagnostics: "./dia/lib.dia"} +// BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["./obj/advanced_output_file_map.o", "./obj/main.o", "./obj/lib.o"], output: {swiftmodule: "./OutputFileMap.swiftmodule", swiftdoc: ".{{[/\\]}}OutputFileMap.swiftdoc", swiftsourceinfo: ".{{[/\\]}}OutputFileMap.swiftsourceinfo"} // BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "ld{{(.exe)?}}", inputs: ["./obj/advanced_output_file_map.o", "./obj/main.o", "./obj/lib.o", "./OutputFileMap.swiftmodule"], output: {image: "./advanced_output_file_map.out"} // BINDINGS-ENA: # "x86_64-apple-macosx10.9" - "dsymutil{{(\.exe)?}}", inputs: ["./advanced_output_file_map.out"], output: {dSYM: "./advanced_output_file_map.out.dSYM"} diff --git a/test/Driver/basic_output_file_map.swift b/test/Driver/basic_output_file_map.swift index 278955337cdf0..b1bde3204a649 100644 --- a/test/Driver/basic_output_file_map.swift +++ b/test/Driver/basic_output_file_map.swift @@ -7,7 +7,7 @@ // DUMPOFM: {{.*}}/Inputs/main.swift -> object: "/build/main.o" // DUMPOFM: {{.*}}/basic_output_file_map.swift -> object: "/build/basic_output_file_map.o" -// BINDINGS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/basic_output_file_map.swift"], output: {object: "/build/basic_output_file_map.o"} -// BINDINGS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/Inputs/main.swift"], output: {object: "/build/main.o"} -// BINDINGS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/Inputs/lib.swift"], output: {object: "/build/lib.o"} +// BINDINGS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/basic_output_file_map.swift"], output: {object: "/build/basic_output_file_map.o"} +// BINDINGS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/Inputs/main.swift"], output: {object: "/build/main.o"} +// BINDINGS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/Inputs/lib.swift"], output: {object: "/build/lib.o"} // BINDINGS: # "x86_64-apple-macosx10.9" - "ld{{(\.exe)?}}", inputs: ["/build/basic_output_file_map.o", "/build/main.o", "/build/lib.o"], output: {image: "/build/basic_output_file_map.out"} diff --git a/test/Driver/batch_mode_aux_file_order.swift b/test/Driver/batch_mode_aux_file_order.swift index 6973eb5f5b0ba..d2af550865be3 100644 --- a/test/Driver/batch_mode_aux_file_order.swift +++ b/test/Driver/batch_mode_aux_file_order.swift @@ -12,9 +12,9 @@ // // Each batch should get 3 primaries; check that each has 3 modules _in the same numeric order_. // -// CHECK: {{.*[\\/]}}swift{{c?(\.exe)?"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[A1:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[A2:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[A3:[0-9]+]].swift{{"?}} +// CHECK: {{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[A1:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[A2:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[A3:[0-9]+]].swift{{"?}} // CHECK-SAME: -o {{.*[\\/]}}file-[[A1]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -o {{.*[\\/]}}file-[[A2]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -o {{.*[\\/]}}file-[[A3]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -// CHECK: {{.*[\\/]}}swift{{c?(\.exe)?"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[B1:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[B2:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[B3:[0-9]+]].swift{{"?}} +// CHECK: {{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[B1:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[B2:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[B3:[0-9]+]].swift{{"?}} // CHECK-SAME: -o {{.*[\\/]}}file-[[B1]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -o {{.*[\\/]}}file-[[B2]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -o {{.*[\\/]}}file-[[B3]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -// CHECK: {{.*[\\/]}}swift{{c?(\.exe)?"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[C1:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[C2:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[C3:[0-9]+]].swift{{"?}} +// CHECK: {{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[C1:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[C2:[0-9]+]].swift{{"?}} {{.*}}-primary-file {{[^ ]*[\\/]}}file-[[C3:[0-9]+]].swift{{"?}} // CHECK-SAME: -o {{.*[\\/]}}file-[[C1]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -o {{.*[\\/]}}file-[[C2]]-{{[a-z0-9]+}}.swiftmodule{{"?}} -o {{.*[\\/]}}file-[[C3]]-{{[a-z0-9]+}}.swiftmodule{{"?}} diff --git a/test/Driver/batch_mode_parseable_output-fine.swift b/test/Driver/batch_mode_parseable_output-fine.swift index 21b3b3e0f1190..f3ecc62b2492e 100644 --- a/test/Driver/batch_mode_parseable_output-fine.swift +++ b/test/Driver/batch_mode_parseable_output-fine.swift @@ -9,8 +9,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "compile", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -c -primary-file {{.*}}/file-01.swift{{(\\")?}} {{.*}}file-02.swift{{(\\")?}} {{.*}}file-03.swift{{(\\")?}} {{.*}}main.swift{{(\\")?}} -emit-module-path {{.*}}file-01-[[MODULE01:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*}}file-01-[[SWIFTDOC01:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*}}file-01-[[OBJ01:[a-z0-9]+]].o{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -c -primary-file {{.*}}/file-01.swift{{(\\")?}} {{.*}}file-02.swift{{(\\")?}} {{.*}}file-03.swift{{(\\")?}} {{.*}}main.swift{{(\\")?}} -emit-module-path {{.*}}file-01-[[MODULE01:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*}}file-01-[[SWIFTDOC01:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*}}file-01-[[OBJ01:[a-z0-9]+]].o{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-c", @@ -58,8 +58,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "compile", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -c {{.*}}file-01.swift{{(\\")?}} -primary-file {{.*}}file-02.swift{{(\\")?}} {{.*}}file-03.swift{{(\\")?}} {{.*}}main.swift{{(\\")?}} -emit-module-path {{.*}}file-02-[[MODULE02:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*}}file-02-[[SWIFTDOC02:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*}}file-02-[[OBJ02:[a-z0-9]+]].o{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -c {{.*}}file-01.swift{{(\\")?}} -primary-file {{.*}}file-02.swift{{(\\")?}} {{.*}}file-03.swift{{(\\")?}} {{.*}}main.swift{{(\\")?}} -emit-module-path {{.*}}file-02-[[MODULE02:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*}}file-02-[[SWIFTDOC02:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*}}file-02-[[OBJ02:[a-z0-9]+]].o{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-c", @@ -107,8 +107,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "compile", -// CHECK-NEXT: "command": "{{.*}}swift{{c?(\.exe)?(\\")?}} -frontend -c {{.*}}file-01.swift{{(\\")?}} {{.*}}file-02.swift{{(\\")?}} -primary-file {{.*}}file-03.swift{{(\\")?}} {{.*}}main.swift{{(\\")?}} -emit-module-path {{.*}}file-03-[[MODULE03:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*}}file-03-[[SWIFTDOC03:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*}}file-03-[[OBJ03:[a-z0-9]+]].o{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?}}", +// CHECK-NEXT: "command": "{{.*}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -c {{.*}}file-01.swift{{(\\")?}} {{.*}}file-02.swift{{(\\")?}} -primary-file {{.*}}file-03.swift{{(\\")?}} {{.*}}main.swift{{(\\")?}} -emit-module-path {{.*}}file-03-[[MODULE03:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*}}file-03-[[SWIFTDOC03:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*}}file-03-[[OBJ03:[a-z0-9]+]].o{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-c", @@ -156,8 +156,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "compile", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -c {{.*[\\/]}}file-01.swift{{(\\")?}} {{.*[\\/]}}file-02.swift{{(\\")?}} {{.*[\\/]}}file-03.swift{{(\\")?}} -primary-file {{.*[\\/]}}main.swift{{(\\")?}} -emit-module-path {{.*[\\/]}}main-[[MODULEMAIN:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*[\\/]}}main-[[SWIFTDOCMAIN:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*[\\/]}}main-[[OBJMAIN:[a-z0-9]+]].o{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -c {{.*[\\/]}}file-01.swift{{(\\")?}} {{.*[\\/]}}file-02.swift{{(\\")?}} {{.*[\\/]}}file-03.swift{{(\\")?}} -primary-file {{.*[\\/]}}main.swift{{(\\")?}} -emit-module-path {{.*[\\/]}}main-[[MODULEMAIN:[a-z0-9]+]].swiftmodule{{(\\")?}} -emit-module-doc-path {{.*[\\/]}}main-[[SWIFTDOCMAIN:[a-z0-9]+]].swiftdoc{{(\\")?}} {{.*}} {{.*}} -module-name main -o {{.*[\\/]}}main-[[OBJMAIN:[a-z0-9]+]].o{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-c", @@ -249,8 +249,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "merge-module", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}file-01-[[MODULE01]].swiftmodule{{(\\")?}} {{.*[\\/]}}file-02-[[MODULE02]].swiftmodule{{(\\")?}} {{.*[\\/]}}file-03-[[MODULE03]].swiftmodule{{(\\")?}} {{.*[\\/]}}main-[[MODULEMAIN]].swiftmodule{{(\\")?}} {{.*}} -emit-module-doc-path main.swiftdoc -emit-module-source-info-path main.swiftsourceinfo -module-name main -o main.swiftmodule", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}file-01-[[MODULE01]].swiftmodule{{(\\")?}} {{.*[\\/]}}file-02-[[MODULE02]].swiftmodule{{(\\")?}} {{.*[\\/]}}file-03-[[MODULE03]].swiftmodule{{(\\")?}} {{.*[\\/]}}main-[[MODULEMAIN]].swiftmodule{{(\\")?}} {{.*}} -emit-module-doc-path main.swiftdoc -emit-module-source-info-path main.swiftsourceinfo -module-name main -o main.swiftmodule", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-merge-modules", diff --git a/test/Driver/bindings.swift b/test/Driver/bindings.swift index c9d5111d15d69..dfdca5d9a4aa8 100644 --- a/test/Driver/bindings.swift +++ b/test/Driver/bindings.swift @@ -1,47 +1,47 @@ // RUN: %empty-directory(%t) // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 %/s 2>&1 | %FileCheck %s -check-prefix=BASIC -// BASIC: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "[[OBJECT:.*\.o]]"} +// BASIC: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "[[OBJECT:.*\.o]]"} // BASIC: # "x86_64-apple-macosx10.9" - "ld{{(.exe)?}}", inputs: ["[[OBJECT]]"], output: {image: "bindings"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 - 2>&1 | %FileCheck %s -check-prefix=STDIN -// STDIN: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["-"], output: {object: "[[OBJECT:.*\.o]]"} +// STDIN: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["-"], output: {object: "[[OBJECT:.*\.o]]"} // STDIN: # "x86_64-apple-macosx10.9" - "ld{{(.exe)?}}", inputs: ["[[OBJECT]]"], output: {image: "main"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 %/S/Inputs/invalid-module-name.swift 2>&1 | %FileCheck %s -check-prefix=INVALID-NAME-SINGLE-FILE -// INVALID-NAME-SINGLE-FILE: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}/Inputs/invalid-module-name.swift"], output: {object: "[[OBJECT:.*\.o]]"} +// INVALID-NAME-SINGLE-FILE: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}/Inputs/invalid-module-name.swift"], output: {object: "[[OBJECT:.*\.o]]"} // INVALID-NAME-SINGLE-FILE: # "x86_64-apple-macosx10.9" - "ld{{(.exe)?}}", inputs: ["[[OBJECT]]"], output: {image: "invalid-module-name"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -o NamedOutput %/s 2>&1 | %FileCheck %s -check-prefix=NAMEDIMG // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -module-name NamedOutput %/s 2>&1 | %FileCheck %s -check-prefix=NAMEDIMG -// NAMEDIMG: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "[[OBJECT:.*\.o]]"} +// NAMEDIMG: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "[[OBJECT:.*\.o]]"} // NAMEDIMG: # "x86_64-apple-macosx10.9" - "ld{{(.exe)?}}", inputs: ["[[OBJECT]]"], output: {image: "NamedOutput"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -c %/s 2>&1 | %FileCheck %s -check-prefix=OBJ -// OBJ: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "bindings.o"} +// OBJ: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "bindings.o"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -c %/s -o /build/bindings.o 2>&1 | %FileCheck %s -check-prefix=NAMEDOBJ -// NAMEDOBJ: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "/build/bindings.o"} +// NAMEDOBJ: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "/build/bindings.o"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -emit-sil %/s 2>&1 | %FileCheck %s -check-prefix=SIL -// SIL: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {sil: "-"} +// SIL: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {sil: "-"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -emit-ir %S/Inputs/empty.sil 2>&1 | %FileCheck %s -check-prefix=SIL-INPUT -// SIL-INPUT: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}empty.sil"], output: {llvm-ir: "-"} +// SIL-INPUT: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}empty.sil"], output: {llvm-ir: "-"} // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 -c -incremental %/s 2>&1 | %FileCheck %s -check-prefix=OBJ-AND-DEPS -// OBJ-AND-DEPS: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: { +// OBJ-AND-DEPS: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: { // OBJ-AND-DEPS-DAG: swift-dependencies: "bindings.swiftdeps" // OBJ-AND-DEPS-DAG: object: "bindings.o" // OBJ-AND-DEPS: } // RUN: echo '{"%/s": {"object": "objroot/bindings.o"}}' > %t/map.json // RUN: %swiftc_driver -driver-print-bindings -output-file-map %t/map.json -target x86_64-apple-macosx10.9 %/s 2>&1 | %FileCheck %s -check-prefix=MAP -// MAP: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "objroot/bindings.o"} +// MAP: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift"], output: {object: "objroot/bindings.o"} // RUN: echo '{"": {"object": "objroot/bindings.o"}}' > %t/map.json // RUN: %swiftc_driver -driver-print-bindings -output-file-map %t/map.json -whole-module-optimization -target x86_64-apple-macosx10.9 %/s %S/Inputs/lib.swift 2>&1 | %FileCheck %s -check-prefix=MAP-WFO -// MAP-WFO: # "x86_64-apple-macosx10.9" - "swift{{c?(\.exe)?}}", inputs: ["{{.*}}bindings.swift", "{{.*}}lib.swift"], output: {object: "objroot/bindings.o"} +// MAP-WFO: # "x86_64-apple-macosx10.9" - "swift{{(-frontend|c)?(\.exe)?}}", inputs: ["{{.*}}bindings.swift", "{{.*}}lib.swift"], output: {object: "objroot/bindings.o"} // RUN: touch %t/a.o %t/b.o // RUN: %swiftc_driver -driver-print-bindings -target x86_64-apple-macosx10.9 %t/a.o %t/b.o -o main 2>&1 | %FileCheck %s -check-prefix=LINK-ONLY diff --git a/test/Driver/bridging-pch.swift b/test/Driver/bridging-pch.swift index 844698b42d47d..f3c728a4b42e0 100644 --- a/test/Driver/bridging-pch.swift +++ b/test/Driver/bridging-pch.swift @@ -11,14 +11,14 @@ // NOPCHACT: 1: compile, {0}, none // RUN: %target-build-swift -typecheck -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h %s 2>&1 | %FileCheck %s -check-prefix=YESPCHJOB -// YESPCHJOB: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -emit-pch -o {{.*}}bridging-header-{{.*}}.pch -// YESPCHJOB: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}bridging-header-{{.*}}.pch +// YESPCHJOB: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -emit-pch -o {{.*}}bridging-header-{{.*}}.pch +// YESPCHJOB: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}bridging-header-{{.*}}.pch // RUN: %target-build-swift -typecheck -disable-bridging-pch -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h %s 2>&1 | %FileCheck %s -check-prefix=NOPCHJOB -// NOPCHJOB: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}Inputs/bridging-header.h +// NOPCHJOB: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}Inputs/bridging-header.h // RUN: %target-build-swift -typecheck -driver-print-jobs -index-store-path %t/idx -import-objc-header %S/Inputs/bridging-header.h %s 2>&1 | %FileCheck %s -check-prefix=INDEXSTORE -// INDEXSTORE: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -index-store-path {{.*}}/idx{{"?}} -emit-pch -o {{.*}}bridging-header-{{.*}}.pch +// INDEXSTORE: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -index-store-path {{.*}}/idx{{"?}} -emit-pch -o {{.*}}bridging-header-{{.*}}.pch // RUN: echo "{\"\": {\"swift-dependencies\": \"%/t/master.swiftdeps\"}, \"%/s\": {\"swift-dependencies\": \"%/t/bridging-header.swiftdeps\"}}" > %t.json // RUN: %target-build-swift -typecheck -incremental -enable-bridging-pch -output-file-map %t.json -import-objc-header %S/Inputs/bridging-header.h %s @@ -49,25 +49,25 @@ // RUN: %target-build-swift -typecheck -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h -pch-output-dir %t/pch %s 2>&1 | %FileCheck %s -check-prefix=PERSISTENT-YESPCHJOB // RUN: %target-build-swift -typecheck -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h -pch-output-dir %t/pch %s %S/Inputs/error.swift -driver-batch-count 2 -enable-batch-mode 2>&1 | %FileCheck %s -check-prefix=PERSISTENT-YESPCHJOB -// PERSISTENT-YESPCHJOB: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -emit-pch -pch-output-dir {{.*}}/pch -// PERSISTENT-YESPCHJOB: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}bridging-header.h{{"?}} -pch-output-dir {{.*}}/pch{{"?}} -pch-disable-validation +// PERSISTENT-YESPCHJOB: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -emit-pch -pch-output-dir {{.*}}/pch +// PERSISTENT-YESPCHJOB: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}bridging-header.h{{"?}} -pch-output-dir {{.*}}/pch{{"?}} -pch-disable-validation // RUN: %target-build-swift -typecheck -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h -pch-output-dir %t/pch -serialize-diagnostics %s 2>&1 | %FileCheck %s -check-prefix=PERSISTENT-YESPCHJOB-DIAG1 -// PERSISTENT-YESPCHJOB-DIAG1: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -serialize-diagnostics-path {{.*}}bridging-header-{{.*}}.dia{{"?}} {{.*}} -emit-pch -pch-output-dir {{.*}}/pch +// PERSISTENT-YESPCHJOB-DIAG1: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -serialize-diagnostics-path {{.*}}bridging-header-{{.*}}.dia{{"?}} {{.*}} -emit-pch -pch-output-dir {{.*}}/pch // RUN: %target-build-swift -typecheck -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h -pch-output-dir %t/pch-out-dir -serialize-diagnostics %s -emit-module -emit-module-path /module-path-dir 2>&1 | %FileCheck %s -check-prefix=PERSISTENT-YESPCHJOB-DIAG2 -// PERSISTENT-YESPCHJOB-DIAG2: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -serialize-diagnostics-path {{.*}}/pch-out-dir{{/|\\\\}}bridging-header-{{.*}}.dia{{"?}} {{.*}} -emit-pch -pch-output-dir {{.*}}/pch-out-dir +// PERSISTENT-YESPCHJOB-DIAG2: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -serialize-diagnostics-path {{.*}}/pch-out-dir{{/|\\\\}}bridging-header-{{.*}}.dia{{"?}} {{.*}} -emit-pch -pch-output-dir {{.*}}/pch-out-dir // RUN: %target-build-swift -typecheck -import-objc-header %S/Inputs/bridging-header.h -pch-output-dir %t/pch -parseable-output -driver-skip-execution %s 2>&1 | %FileCheck %s -check-prefix=PERSISTENT-OUTPUT // PERSISTENT-OUTPUT-NOT: "outputs": [ // RUN: %target-build-swift -typecheck -driver-print-jobs -import-objc-header %S/Inputs/bridging-header.h -pch-output-dir %t/pch -whole-module-optimization %s 2>&1 | %FileCheck %s -check-prefix=PERSISTENT-WMO-YESPCHJOB --implicit-check-not pch-disable-validation -// PERSISTENT-WMO-YESPCHJOB: {{.*}}swift{{c?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}bridging-header.h{{"?}} -pch-output-dir {{.*}}/pch +// PERSISTENT-WMO-YESPCHJOB: {{.*}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend {{.*}} -import-objc-header {{.*}}bridging-header.h{{"?}} -pch-output-dir {{.*}}/pch // RUN: %target-build-swift -typecheck -disable-bridging-pch -driver-print-jobs -import-objc-header %/S/Inputs/bridging-header.h -pch-output-dir %t/pch %/s 2>&1 | %FileCheck %s -check-prefix=NOPCHJOB // RUN: %target-build-swift -typecheck -incremental -enable-bridging-pch -output-file-map %t.json -import-objc-header %S/Inputs/bridging-header.h -pch-output-dir %t/pch %s // RUN: %target-build-swift -### -typecheck -O -import-objc-header %S/Inputs/bridging-header.h %s 2>&1 | %FileCheck %s -check-prefix=OPTPCH -// OPTPCH: swift{{c?(\.exe)?"?}} -frontend +// OPTPCH: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // OPTPCH-SAME: -O{{ }} // OPTPCH-SAME: -emit-pch diff --git a/test/Driver/embed-bitcode.swift b/test/Driver/embed-bitcode.swift index 60bee1411ec8d..c1ced3bdbe4c9 100644 --- a/test/Driver/embed-bitcode.swift +++ b/test/Driver/embed-bitcode.swift @@ -1,6 +1,6 @@ // RUN: %target-swiftc_driver -driver-print-bindings -embed-bitcode %s 2>&1 | %FileCheck -check-prefix=CHECK-%target-object-format %s -// CHECK-macho: "swift", inputs: ["{{.*}}embed-bitcode.swift"], output: {llvm-bc: "[[BC:.*\.bc]]"} -// CHECK-macho: "swift", inputs: ["[[BC]]"], output: {object: "[[OBJECT:.*\.o]]"} +// CHECK-macho: "swift-frontend", inputs: ["{{.*}}embed-bitcode.swift"], output: {llvm-bc: "[[BC:.*\.bc]]"} +// CHECK-macho: "swift-frontend", inputs: ["[[BC]]"], output: {object: "[[OBJECT:.*\.o]]"} // CHECK-macho: "ld", inputs: ["[[OBJECT]]"], output: {image: "embed-bitcode"} // CHECK-coff: "swiftc.{{exe}}", inputs: ["{{.*}}embed-bitcode.swift"], output: {llvm-bc: "[[BC:.*\.bc]]"} // CHECK-coff: "swiftc.{{exe}}", inputs: ["[[BC]]"], output: {object: "[[OBJECT:.*\.o]]"} @@ -93,23 +93,23 @@ // CHECK-LIB-WMO: -parse-stdlib // RUN: %target-swiftc_driver -embed-bitcode -c -parse-as-library -emit-module %s %S/../Inputs/empty.swift -module-name ABC 2>&1 -### | %FileCheck %s -check-prefix=CHECK-LIB -// CHECK-LIB: swift{{c?(\.exe)?"?}} -frontend +// CHECK-LIB: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-LIB: -emit-bc // CHECK-LIB: -primary-file -// CHECK-LIB: swift{{c?(\.exe)?"?}} -frontend +// CHECK-LIB: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-LIB: -emit-bc // CHECK-LIB: -primary-file -// CHECK-LIB: swift{{c?(\.exe)?"?}} -frontend +// CHECK-LIB: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-LIB: -c // CHECK-LIB: -embed-bitcode // CHECK-LIB: -disable-llvm-optzns -// CHECK-LIB: swift{{c?(\.exe)?"?}} -frontend +// CHECK-LIB: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-LIB: -c // CHECK-LIB: -embed-bitcode // CHECK-LIB: -disable-llvm-optzns -// CHECK-LIB: swift{{c?(\.exe)?"?}} -frontend +// CHECK-LIB: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-LIB: -emit-module -// CHECK-LIB-NOT: swift{{c?(\.exe)?"?}} -frontend +// CHECK-LIB-NOT: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // RUN: %target-swiftc_driver -embed-bitcode -emit-module %s 2>&1 -### | %FileCheck %s -check-prefix=WARN-EMBED-BITCODE // RUN: %target-swiftc_driver -embed-bitcode -emit-module-path a.swiftmodule %s 2>&1 -### | %FileCheck %s -check-prefix=WARN-EMBED-BITCODE diff --git a/test/Driver/emit-interface.swift b/test/Driver/emit-interface.swift index 739aeb1455ed3..2b71d6cc523d7 100644 --- a/test/Driver/emit-interface.swift +++ b/test/Driver/emit-interface.swift @@ -1,14 +1,14 @@ // RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo 2>&1 | %FileCheck %s -// CHECK: swift{{c?(\.exe)?"?}} -frontend +// CHECK: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-SAME: emit-interface.swift -// CHECK: swift{{c?(\.exe)?"?}} -frontend -merge-modules +// CHECK: swift{{(-frontend|c)?(\.exe)?"?}} -frontend -merge-modules // CHECK-SAME: -emit-module-interface-path {{.+[/\\]}}foo.swiftinterface // CHECK: {{(bin/)?}}ld // RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-WHOLE-MODULE %s -// CHECK-WHOLE-MODULE: swift{{c?(\.exe)?"?}} -frontend +// CHECK-WHOLE-MODULE: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-WHOLE-MODULE-SAME: emit-interface.swift // CHECK-WHOLE-MODULE-SAME: -emit-module-interface-path {{.+[/\\]}}foo.swiftinterface // CHECK-WHOLE-MODULE-NOT: -merge-modules @@ -16,13 +16,13 @@ // RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface-path %t/unrelated.swiftinterface -o %t/foo -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-EXPLICIT-PATH %s -// CHECK-EXPLICIT-PATH: swift{{c?(\.exe)?"?}} -frontend +// CHECK-EXPLICIT-PATH: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-EXPLICIT-PATH-SAME: emit-interface.swift // CHECK-EXPLICIT-PATH-SAME: -emit-module-interface-path {{.+[/\\]}}unrelated.swiftinterface // Ensure that we emit arguments when we force filelists as well // RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-module-interface -o %t/foo -module-name foo -whole-module-optimization -driver-filelist-threshold=0 2>&1 | %FileCheck -check-prefix=CHECK-FILELIST %s -// CHECK-FILELIST: swift{{c?(\.exe)?"?}} -frontend +// CHECK-FILELIST: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-FILELIST-SAME: -supplementary-output-file-map // CHECK-FILELIST-NOT: emit-interface.swift{{ }} diff --git a/test/Driver/emit-objc-header.swift b/test/Driver/emit-objc-header.swift index cfea2b91bd014..841b367bbb3bc 100644 --- a/test/Driver/emit-objc-header.swift +++ b/test/Driver/emit-objc-header.swift @@ -1,14 +1,14 @@ // RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-objc-header-path %t/foo.h 2>&1 | %FileCheck %s -// CHECK: swift{{c?(\.exe)?"?}} -frontend +// CHECK: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-SAME: emit-objc-header.swift -// CHECK: swift{{c?(\.exe)?"?}} -frontend -merge-modules +// CHECK: swift{{(-frontend|c)?(\.exe)?"?}} -frontend -merge-modules // CHECK-SAME: -emit-objc-header-path {{.+}}/foo.h // CHECK: {{(bin/)?}}ld // RUN: %swiftc_driver -driver-print-jobs -target x86_64-apple-macosx10.9 %s -emit-objc-header-path %t/foo.h -whole-module-optimization 2>&1 | %FileCheck -check-prefix=CHECK-WHOLE-MODULE %s -// CHECK-WHOLE-MODULE: swift{{c?(\.exe)?"?}} -frontend +// CHECK-WHOLE-MODULE: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // CHECK-WHOLE-MODULE-SAME: emit-objc-header.swift // CHECK-WHOLE-MODULE-SAME: -emit-objc-header-path {{.+}}/foo.h // CHECK-WHOLE-MODULE-NOT: -merge-modules diff --git a/test/Driver/merge-module.swift b/test/Driver/merge-module.swift index 436929598b675..b8cf77ba0ee13 100644 --- a/test/Driver/merge-module.swift +++ b/test/Driver/merge-module.swift @@ -16,27 +16,27 @@ // RUN: %swiftc_driver -emit-module -driver-print-jobs -driver-filelist-threshold=0 %s %S/../Inputs/empty.swift -module-name main 2>&1 | %FileCheck -check-prefix FILELISTS %s -// CHECK: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// CHECK: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // CHECK: -module-name {{[^ ]+}} // CHECK: -o [[OBJECTFILE:.*]] -// CHECK-NEXT: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// CHECK-NEXT: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // CHECK: -emit-module // CHECK: -module-name {{[^ ]+}} // CHECK: -o {{[^ ]+}} -// SIMPLE: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// SIMPLE: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // SIMPLE: -emit-module // SIMPLE: -primary-file // SIMPLE: -emit-module-doc-path {{[^ ]*[/\\]}}merge-module-{{[^ ]*}}.swiftdoc // SIMPLE: -o {{[^ ]*[/\\]}}merge-module-{{[^ ]*}}.swiftmodule -// SIMPLE: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// SIMPLE: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // SIMPLE: -emit-module // SIMPLE: -o main.swiftmodule -// COMPLEX: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// COMPLEX: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // COMPLEX: -emit-module // COMPLEX-DAG: -emit-module-doc-path {{[^ ]*[/\\]}}merge-module-{{[^ ]*}}.swiftdoc // COMPLEX-DAG: -sdk {{.*}}/Inputs/clang-importer-sdk @@ -44,7 +44,7 @@ // COMPLEX-DAG: -F /path/to/frameworks -F /path/to/more/frameworks // COMPLEX-DAG: -I /path/to/headers -I path/to/more/headers // COMPLEX-DAG: -module-cache-path /tmp/modules -// COMPLEX: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// COMPLEX: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // COMPLEX: -emit-module // COMPLEX-DAG: -F /path/to/frameworks -F /path/to/more/frameworks // COMPLEX-DAG: -I /path/to/headers -I path/to/more/headers @@ -52,27 +52,27 @@ // COMPLEX: -o sdk.out -// TWO-OUTPUTS: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// TWO-OUTPUTS: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // TWO-OUTPUTS: -emit-module-path [[MODULE:[^ ]+]] // TWO-OUTPUTS: -emit-module-doc-path {{[^ ]*[/\\]}}merge-module-{{[^ ]*}}.swiftdoc // TWO-OUTPUTS: -o {{[^ ]*[/\\]}}merge-module-{{[^ ]*}}.o -// TWO-OUTPUTS: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// TWO-OUTPUTS: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // TWO-OUTPUTS: -emit-module [[MODULE]] // TWO-OUTPUTS: -o main.swiftmodule -// THREE-OUTPUTS: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// THREE-OUTPUTS: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // THREE-OUTPUTS: -emit-module-path [[MODULE:[^ ]+]] // THREE-OUTPUTS: -emit-module-doc-path {{[^ ]*[/\\]}}merge-module-{{[^ ]*}}.swiftdoc // THREE-OUTPUTS: -o {{[^ ]*[/\\]}}merge-module-{{[^ ]*}}.o -// THREE-OUTPUTS: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// THREE-OUTPUTS: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // THREE-OUTPUTS: -emit-module [[MODULE]] // THREE-OUTPUTS: -emit-objc-header-path sdk.foo.h // THREE-OUTPUTS: -o sdk.foo.out -// FILELISTS: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend -// FILELISTS-NEXT: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend -// FILELISTS-NEXT: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend +// FILELISTS: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend +// FILELISTS-NEXT: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend +// FILELISTS-NEXT: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend // FILELISTS-NOT: .swiftmodule // FILELISTS: -filelist {{[^ ]+}} // FILELISTS-NOT: .swiftmodule @@ -83,15 +83,15 @@ // RUN: %FileCheck %s < %t.complex.txt // RUN: %FileCheck -check-prefix MERGE_1 %s < %t.complex.txt -// MERGE_1: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend -emit-module -primary-file {{[^ ]+[/\\]}}Inputs{{/|\\\\}}main.swift{{"?}} {{[^ ]+[/\\]}}Inputs{{/|\\\\}}lib.swift +// MERGE_1: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend -emit-module -primary-file {{[^ ]+[/\\]}}Inputs{{/|\\\\}}main.swift{{"?}} {{[^ ]+[/\\]}}Inputs{{/|\\\\}}lib.swift // MERGE_1: -emit-module-doc-path [[PARTIAL_MODULE_A:[^ ]+]].swiftdoc // MERGE_1: -module-name merge // MERGE_1: -o [[PARTIAL_MODULE_A]].swiftmodule -// MERGE_1: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend -emit-module {{[^ ]+[/\\]}}Inputs{{/|\\\\}}main.swift{{"?}} -primary-file {{[^ ]+[/\\]}}Inputs{{/|\\\\}}lib.swift +// MERGE_1: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend -emit-module {{[^ ]+[/\\]}}Inputs{{/|\\\\}}main.swift{{"?}} -primary-file {{[^ ]+[/\\]}}Inputs{{/|\\\\}}lib.swift // MERGE_1: -emit-module-doc-path [[PARTIAL_MODULE_B:[^ ]+]].swiftdoc // MERGE_1: -module-name merge // MERGE_1: -o [[PARTIAL_MODULE_B]].swiftmodule -// MERGE_1: {{bin(/|\\\\)swiftc?(\.exe)?"?}} -frontend -merge-modules -emit-module [[PARTIAL_MODULE_A]].swiftmodule{{"?}} [[PARTIAL_MODULE_B]].swiftmodule +// MERGE_1: {{bin(/|\\\\)swift(-frontend|c)?(\.exe)?"?}} -frontend -merge-modules -emit-module [[PARTIAL_MODULE_A]].swiftmodule{{"?}} [[PARTIAL_MODULE_B]].swiftmodule // MERGE_1: -parse-as-library // MERGE_1: -emit-module-doc-path {{"?}}/tmp{{(/|\\\\)}}modules.swiftdoc{{"?}} // MERGE_1: -module-name merge diff --git a/test/Driver/modulewrap.swift b/test/Driver/modulewrap.swift index 8adbe0afdc6e2..28f59bbc17329 100644 --- a/test/Driver/modulewrap.swift +++ b/test/Driver/modulewrap.swift @@ -1,7 +1,7 @@ // RUN: %swiftc_driver -driver-print-jobs -target x86_64-unknown-linux-gnu -g %s | %FileCheck %s -// CHECK: bin{{/|\\\\}}swift{{c?(\.exe)?"?}} -frontend{{.*}}-emit-module-path [[MOD:.*\.swiftmodule]] -// CHECK: bin{{/|\\\\}}swift{{c?(\.exe)?"?}} {{.*}}-emit-module [[MOD]] +// CHECK: bin{{/|\\\\}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend{{.*}}-emit-module-path [[MOD:.*\.swiftmodule]] +// CHECK: bin{{/|\\\\}}swift{{(-frontend|c)?(\.exe)?"?}} {{.*}}-emit-module [[MOD]] // CHECK-SAME: -o [[MERGED:.*\.swiftmodule]] -// CHECK: bin{{/|\\\\}}swift{{c?(\.exe)?"?}} -modulewrap [[MERGED]]{{"?}} -target x86_64-unknown-linux-gnu -o [[OBJ:.*\.o]] +// CHECK: bin{{/|\\\\}}swift{{(-frontend|c)?(\.exe)?"?}} -modulewrap [[MERGED]]{{"?}} -target x86_64-unknown-linux-gnu -o [[OBJ:.*\.o]] // CHECK: bin{{/|\\\\}}clang{{.*}} [[OBJ]] diff --git a/test/Driver/options.swift b/test/Driver/options.swift index fbdf2a86f6f6a..5f1fe4649c35f 100644 --- a/test/Driver/options.swift +++ b/test/Driver/options.swift @@ -83,11 +83,11 @@ // RUN: %swiftc_driver -incremental %s -### 2>&1 | %FileCheck -check-prefix=INCREMENTAL_WITHOUT_OFM %s // INCREMENTAL_WITHOUT_OFM: warning: ignoring -incremental (currently requires an output file map) -// INCREMENTAL_WITHOUT_OFM: swift{{c?(\.exe)?"?}} -frontend +// INCREMENTAL_WITHOUT_OFM: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // RUN: %swiftc_driver -incremental -output-file-map %S/Inputs/empty-ofm.json %s -### 2>&1 | %FileCheck -check-prefix=INCREMENTAL_WITHOUT_OFM_ENTRY %s // INCREMENTAL_WITHOUT_OFM_ENTRY: ignoring -incremental; output file map has no master dependencies entry ("swift-dependencies" under "") -// INCREMENTAL_WITHOUT_OFM_ENTRY: swift{{c?(\.exe)?"?}} -frontend +// INCREMENTAL_WITHOUT_OFM_ENTRY: swift{{(-frontend|c)?(\.exe)?"?}} -frontend // RUN: %swiftc_driver -driver-print-jobs -enforce-exclusivity=checked %s | %FileCheck -check-prefix=EXCLUSIVITY_CHECKED %s // EXCLUSIVITY_CHECKED: swift diff --git a/test/Driver/parseable_output.swift b/test/Driver/parseable_output.swift index 1c3f02bb54963..b955298cfd568 100644 --- a/test/Driver/parseable_output.swift +++ b/test/Driver/parseable_output.swift @@ -6,8 +6,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "compile", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -c -primary-file {{.*[\\/]}}parseable_output.swift{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output-[[OUTPUT:.*]].o{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -c -primary-file {{.*[\\/]}}parseable_output.swift{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output-[[OUTPUT:.*]].o{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-c", @@ -67,8 +67,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "merge-module", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}parseable_output-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output.swift.tmp.swiftmodule{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}parseable_output-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output.swift.tmp.swiftmodule{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-merge-modules", diff --git a/test/Driver/parseable_output_unicode.swift b/test/Driver/parseable_output_unicode.swift index fba7dbbb05d84..31e84f7263f30 100644 --- a/test/Driver/parseable_output_unicode.swift +++ b/test/Driver/parseable_output_unicode.swift @@ -8,8 +8,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "compile", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -c -primary-file {{.*[\\/]}}你好.swift{{(\\")? .*}} -o {{.*[\\/]}}你好-[[OUTPUT:.*]].o{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -c -primary-file {{.*[\\/]}}你好.swift{{(\\")? .*}} -o {{.*[\\/]}}你好-[[OUTPUT:.*]].o{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-c", @@ -69,8 +69,8 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "merge-module", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule{{(\\")?}}", -// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{c?(\.exe)?(\\")?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift-frontend{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule{{(\\")?}}", +// CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", // CHECK-NEXT: "-merge-modules", diff --git a/test/Driver/response-file.swift b/test/Driver/response-file.swift index 5aa6b65a8fb96..596be09747fbf 100644 --- a/test/Driver/response-file.swift +++ b/test/Driver/response-file.swift @@ -33,7 +33,7 @@ // RUN: %target-build-swift -typecheck -v @%t.5.resp %s 2>&1 | %FileCheck %s -check-prefix=VERBOSE // VERBOSE: @{{[^ ]*}}arguments-{{[0-9a-zA-Z]+}}.resp{{"?}} # -frontend -typecheck -primary-file // RUN: not %target-swiftc_driver %s @%t.5.resp -Xfrontend -debug-crash-immediately 2>&1 | %FileCheck %s -check-prefix=TRACE -// TRACE: Program arguments: {{[^ ]*}}swift{{c?(\.exe)?}} -frontend -c -primary-file +// TRACE: Program arguments: {{[^ ]*}}swift{{(-frontend|c)?(\.exe)?}} -frontend -c -primary-file #if TEST0 diff --git a/test/Driver/subcommands.swift b/test/Driver/subcommands.swift index 72bcc98b93a22..1838ae7d40789 100644 --- a/test/Driver/subcommands.swift +++ b/test/Driver/subcommands.swift @@ -20,7 +20,7 @@ // RUN: cd %t.dir && %swift_driver_plain -### t.swift 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-INTERPRETER %s // RUN: cd %t.dir && %swift_driver_plain -### subpath/build 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-INTERPRETER %s -// CHECK-SWIFT-INVOKES-INTERPRETER: {{.*}}/swift -frontend -interpret +// CHECK-SWIFT-INVOKES-INTERPRETER: {{.*}}/swift-frontend -frontend -interpret // Check that 'swift foo' invokes 'swift-foo'. diff --git a/test/Driver/vfs.swift b/test/Driver/vfs.swift index 21409e5d276d2..52f7731558196 100644 --- a/test/Driver/vfs.swift +++ b/test/Driver/vfs.swift @@ -1,9 +1,9 @@ // Verifies that the driver passes the -vfsoverlay flag to the frontend (SR-12834). // RUN: %swiftc_driver -driver-print-jobs -c -vfsoverlay overlay.yaml %s | %FileCheck --check-prefix=CHECK-ONE %s -// CHECK-ONE: bin{{/|\\\\}}swift{{c?(\.exe)?"?}} -frontend{{.*}}-c{{.*}}-vfsoverlay overlay.yaml +// CHECK-ONE: bin{{/|\\\\}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend{{.*}}-c{{.*}}-vfsoverlay overlay.yaml // Verifies that multiple occurrences are passed in order. // RUN: %swiftc_driver -driver-print-jobs -c -vfsoverlay overlay1.yaml -vfsoverlay overlay2.yaml -vfsoverlay overlay3.yaml %s | %FileCheck --check-prefix=CHECK-MULTIPLE %s -// CHECK-MULTIPLE: bin{{/|\\\\}}swift{{c?(\.exe)?"?}} -frontend{{.*}}-c{{.*}}-vfsoverlay overlay1.yaml -vfsoverlay overlay2.yaml -vfsoverlay overlay3.yaml +// CHECK-MULTIPLE: bin{{/|\\\\}}swift{{(-frontend|c)?(\.exe)?"?}} -frontend{{.*}}-c{{.*}}-vfsoverlay overlay1.yaml -vfsoverlay overlay2.yaml -vfsoverlay overlay3.yaml diff --git a/test/Index/Store/driver-index.swift b/test/Index/Store/driver-index.swift index b6737f869c1b8..a45c4f0daaf48 100644 --- a/test/Index/Store/driver-index.swift +++ b/test/Index/Store/driver-index.swift @@ -1,2 +1,2 @@ // RUN: %swiftc_driver -driver-print-jobs -index-file -index-file-path %s %S/Inputs/SwiftModuleA.swift %s -o %t.output_for_index -index-store-path %t.index_store -module-name driver_index 2>&1 | %FileCheck %s -// CHECK: {{.*}}swift{{(c\.exe")?}} -frontend -typecheck {{.*}}SwiftModuleA.swift{{"?}} -primary-file {{.*}}driver-index.swift{{"?}} {{.*}}-o {{.*}}.output_for_index{{"?}} {{.*}}-disable-typo-correction {{.*}}-index-store-path {{.*}}.index_store{{"?}} -index-system-modules +// CHECK: {{.*}}swift{{(-frontend)?(c\.exe")?}} -frontend -typecheck {{.*}}SwiftModuleA.swift{{"?}} -primary-file {{.*}}driver-index.swift{{"?}} {{.*}}-o {{.*}}.output_for_index{{"?}} {{.*}}-disable-typo-correction {{.*}}-index-store-path {{.*}}.index_store{{"?}} -index-system-modules diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index 23f1654593201..aabba372ae647 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -1,4 +1,4 @@ -add_swift_host_tool(swift +add_swift_host_tool(swift-frontend driver.cpp autolink_extract_main.cpp modulewrap_main.cpp @@ -6,55 +6,64 @@ add_swift_host_tool(swift swift_symbolgraph_extract_main.cpp SWIFT_COMPONENT compiler ) -target_link_libraries(swift +target_link_libraries(swift-frontend PRIVATE swiftDriver swiftFrontendTool swiftSymbolGraphGen LLVMBitstreamReader) -swift_create_post_build_symlink(swift - SOURCE "swift${CMAKE_EXECUTABLE_SUFFIX}" +swift_create_post_build_symlink(swift-frontend + SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX}" + DESTINATION "swift${CMAKE_EXECUTABLE_SUFFIX}" + WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}") + +swift_create_post_build_symlink(swift-frontend + SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "swiftc${CMAKE_EXECUTABLE_SUFFIX}" WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}") -swift_create_post_build_symlink(swift - SOURCE "swift${CMAKE_EXECUTABLE_SUFFIX}" +swift_create_post_build_symlink(swift-frontend + SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "swift-indent${CMAKE_EXECUTABLE_SUFFIX}" WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}") -swift_create_post_build_symlink(swift - SOURCE "swift${CMAKE_EXECUTABLE_SUFFIX}" +swift_create_post_build_symlink(swift-frontend + SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "swift-symbolgraph-extract${CMAKE_EXECUTABLE_SUFFIX}" WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}") -swift_create_post_build_symlink(swift - SOURCE "swift${CMAKE_EXECUTABLE_SUFFIX}" +swift_create_post_build_symlink(swift-frontend + SOURCE "swift-frontend${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "swift-autolink-extract${CMAKE_EXECUTABLE_SUFFIX}" WORKING_DIRECTORY "${SWIFT_RUNTIME_OUTPUT_INTDIR}") -add_swift_tool_symlink(swiftc swift compiler) -add_swift_tool_symlink(swift-symbolgraph-extract swift compiler) -add_swift_tool_symlink(swift-autolink-extract swift autolink-driver) -add_swift_tool_symlink(swift-indent swift editor-integration) +add_swift_tool_symlink(swift swift-frontend compiler) +add_swift_tool_symlink(swiftc swift-frontend compiler) +add_swift_tool_symlink(swift-symbolgraph-extract swift-frontend compiler) +add_swift_tool_symlink(swift-autolink-extract swift-frontend autolink-driver) +add_swift_tool_symlink(swift-indent swift-frontend editor-integration) # If building as part of clang, make sure the headers are installed. if(NOT SWIFT_BUILT_STANDALONE) - add_dependencies(swift clang-resource-headers) + add_dependencies(swift-frontend clang-resource-headers) endif() -add_dependencies(compiler swift) +add_dependencies(compiler swift-frontend) +swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift${CMAKE_EXECUTABLE_SUFFIX}" + DESTINATION "bin" + COMPONENT compiler) swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swiftc${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "bin" COMPONENT compiler) swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-symbolgraph-extract${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "bin" COMPONENT compiler) -add_dependencies(autolink-driver swift) +add_dependencies(autolink-driver swift-frontend) swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-autolink-extract${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "bin" COMPONENT autolink-driver) -add_dependencies(editor-integration swift) +add_dependencies(editor-integration swift-frontend) swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-indent${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "bin" COMPONENT editor-integration) From ade21a33fded4061edbc525012d42c730a9928e1 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 1 Nov 2019 09:30:15 -0700 Subject: [PATCH 2/9] Fix build of benchmark suite and Linux test --- benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake | 2 +- test/Driver/subcommands.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake b/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake index 2826d3a43d8eb..0f4a776a2ba05 100644 --- a/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake +++ b/benchmark/cmake/modules/AddSwiftBenchmarkSuite.cmake @@ -697,7 +697,7 @@ function(swift_benchmark_compile) cmake_parse_arguments(SWIFT_BENCHMARK_COMPILE "" "PLATFORM" "" ${ARGN}) if(NOT SWIFT_BENCHMARK_BUILT_STANDALONE) - set(stdlib_dependencies "swift") + set(stdlib_dependencies "swift-frontend") foreach(stdlib_dependency ${UNIVERSAL_LIBRARY_NAMES_${SWIFT_BENCHMARK_COMPILE_PLATFORM}}) string(FIND "${stdlib_dependency}" "Unittest" find_output) if("${find_output}" STREQUAL "-1") diff --git a/test/Driver/subcommands.swift b/test/Driver/subcommands.swift index 1838ae7d40789..37801b83bb8df 100644 --- a/test/Driver/subcommands.swift +++ b/test/Driver/subcommands.swift @@ -8,7 +8,7 @@ // RUN: %t.dir/usr/bin/swift -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s // RUN: %t.dir/usr/bin/swift repl -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s -// CHECK-SWIFT-INVOKES-REPL: {{.*}}/swift -frontend -repl +// CHECK-SWIFT-INVOKES-REPL: {{.*}}/swift{{.*}} -repl // RUN: %empty-directory(%t.dir) From 6c0d957ffe2113a2b251c77e93b9606cf02749e1 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 1 Nov 2019 09:31:12 -0700 Subject: [PATCH 3/9] [Driver] Execute the frontend when invoked via swift-frontend. This obviates the need for "-frontend", although we still accept it for backward compatibility. Switch lit's %target-swift-frontend et al over to calling swift-frontend. --- test/Driver/frontend.swift | 4 ++++ test/Frontend/crash.swift | 2 +- test/lit.cfg | 25 ++++++++++++------------- tools/driver/driver.cpp | 8 ++++++++ 4 files changed, 25 insertions(+), 14 deletions(-) create mode 100644 test/Driver/frontend.swift diff --git a/test/Driver/frontend.swift b/test/Driver/frontend.swift new file mode 100644 index 0000000000000..2df7174e41c5e --- /dev/null +++ b/test/Driver/frontend.swift @@ -0,0 +1,4 @@ +// RUN: %swiftc_driver %s -### 2>&1 | %FileCheck %s + +// CHECK: swift-frontend + diff --git a/test/Frontend/crash.swift b/test/Frontend/crash.swift index 951b9db6e6bcd..a95e6cca6c1b0 100644 --- a/test/Frontend/crash.swift +++ b/test/Frontend/crash.swift @@ -3,7 +3,7 @@ // Check that we see the contents of the input file list in the crash log. // CHECK-LABEL: Stack dump -// CHECK-NEXT: Program arguments: {{.*swift(c?)(\.exe)?}} -frontend +// CHECK-NEXT: Program arguments: {{.*swift(-frontend)?(c?)(\.exe)?}} // CHECK-NEXT: Swift version // CHECK-NEXT: Contents of {{.*}}.filelist.txt: // CHECK-NEXT: --- diff --git a/test/lit.cfg b/test/lit.cfg index 82cd7f85e6cde..c25cf5d481584 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -238,6 +238,7 @@ if 'gmalloc' in lit_config.params: config.environment['MALLOC_LOG_FILE'] = '/dev/null' config.available_features.add('gmalloc') +config.swift_frontend = inferSwiftBinary('swift-frontend') config.swift = inferSwiftBinary('swift') config.swiftc = inferSwiftBinary('swiftc') config.sil_opt = inferSwiftBinary('sil-opt') @@ -432,8 +433,8 @@ config.substitutions.append( ('%swift-path', config.swift) ) # This must come after all substitutions containing "%swift". config.substitutions.append( ('%swift', - "%r -frontend %s -disable-objc-attr-requires-foundation-module %s %s" - % (config.swift, mcp_opt, config.swift_test_options, config.swift_frontend_test_options)) ) + "%r %s -disable-objc-attr-requires-foundation-module %s %s" + % (config.swift_frontend, mcp_opt, config.swift_test_options, config.swift_frontend_test_options)) ) config.clang_include_dir = make_path(config.swift, '..', '..', 'include') config.substitutions.append( ('%clang-include-dir', config.clang_include_dir) ) @@ -970,12 +971,12 @@ if run_vendor == 'apple': if run_os == 'maccatalyst': maccatalyst_extra_frameworks = "-F {}/System/iOSSupport/System/Library/Frameworks".format(config.variant_sdk) config.target_swift_frontend = ( - "%s -frontend %s -sdk %r %s %s %s" % - (config.swiftc, target_options, config.variant_sdk, maccatalyst_extra_frameworks, + "%s %s -sdk %r %s %s %s" % + (config.swift_frontend, target_options, config.variant_sdk, maccatalyst_extra_frameworks, config.swift_test_options, config.swift_frontend_test_options)) subst_target_swift_frontend_mock_sdk = ( - "%s -frontend %s -sdk %r %s %s" % - (config.swiftc, target_options_for_mock_sdk, config.variant_sdk, + "%s %s -sdk %r %s %s" % + (config.swift_frontend, target_options_for_mock_sdk, config.variant_sdk, config.swift_test_options, config.swift_frontend_test_options)) config.target_swift_modulewrap = ( '%s -modulewrap -target %s' % @@ -1049,7 +1050,7 @@ elif run_os in ['windows-msvc']: config.target_run = '' config.target_swift_frontend = \ - ('%r -frontend -target %s %s %s %s %s' % (config.swiftc, \ + ('%r -target %s %s %s %s %s' % (config.swift_frontend, \ config.variant_triple, \ resource_dir_opt, mcp_opt, \ config.swift_test_options, \ @@ -1174,8 +1175,8 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows- % (config.target_build_swift)) config.target_add_rpath = r'-Xlinker -rpath -Xlinker \1' config.target_swift_frontend = ( - '%s -frontend -target %s %s %s %s %s ' - % (config.swift, config.variant_triple, resource_dir_opt, mcp_opt, + '%s -target %s %s %s %s %s ' + % (config.swift_frontend, config.variant_triple, resource_dir_opt, mcp_opt, config.swift_test_options, config.swift_frontend_test_options)) subst_target_swift_frontend_mock_sdk = config.target_swift_frontend subst_target_swift_frontend_mock_sdk_after = "" @@ -1293,8 +1294,7 @@ elif run_os == 'linux-androideabi' or run_os == 'linux-android': '-o', "'\\1'"]) config.target_add_rpath = r'-Xlinker -rpath -Xlinker \1' config.target_swift_frontend = ' '.join([ - config.swift, - '-frontend', + config.swift_frontend, '-target', config.variant_triple, android_include_paths_opt, android_link_paths_opt, resource_dir_opt, mcp_opt, config.swift_test_options, @@ -1370,8 +1370,7 @@ elif run_os == 'wasi': % (config.target_build_swift)) config.target_add_rpath = '' config.target_swift_frontend = ' '.join([ - config.swift, - '-frontend', + config.swift_frontend, '-target', config.variant_triple, '-Xcc', '--sysroot=%s' % config.variant_sdk, resource_dir_opt, mcp_opt, diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index e01a9efb59d15..ff189f773ab28 100644 --- a/tools/driver/driver.cpp +++ b/tools/driver/driver.cpp @@ -142,6 +142,14 @@ static int run_driver(StringRef ExecName, } } + // Run the integrated Swift frontend when called as "swift-frontend" but + // without a leading "-frontend". + if (ExecName == "swift-frontend") { + return performFrontend(llvm::makeArrayRef(argv.data()+1, + argv.data()+argv.size()), + argv[0], (void *)(intptr_t)getExecutablePath); + } + std::string Path = getExecutablePath(argv[0]); PrintingDiagnosticConsumer PDC; From bd95fcb5511791b59aade73fb5525f3824e2c6eb Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Tue, 16 Jun 2020 16:51:52 -0700 Subject: [PATCH 4/9] [Test] Fix a test for Windows --- test/Driver/parseable_output_unicode.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Driver/parseable_output_unicode.swift b/test/Driver/parseable_output_unicode.swift index 31e84f7263f30..e9065ee92be91 100644 --- a/test/Driver/parseable_output_unicode.swift +++ b/test/Driver/parseable_output_unicode.swift @@ -69,7 +69,7 @@ // CHECK-NEXT: { // CHECK-NEXT: "kind": "began", // CHECK-NEXT: "name": "merge-module", -// CHECK-NEXT: "command": "{{.*[\\/]}}swift-frontend{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule{{(\\")?}}", +// CHECK-NEXT: "command": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}} -frontend -merge-modules -emit-module {{.*[\\/]}}你好-[[OUTPUT]].swiftmodule{{(\\")?}} {{.*}} -o {{.*[\\/]}}parseable_output_unicode.swift.tmp.swiftmodule{{(\\")?}}", // CHECK-NEXT: "command_executable": "{{.*[\\/]}}swift{{(-frontend|c)?(\.exe)?(\\")?}}", // CHECK-NEXT: "command_arguments": [ // CHECK-NEXT: "-frontend", From bb2d6c59e4ce7cfd78c8ac96212a63d8c5fac833 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Tue, 16 Jun 2020 16:52:08 -0700 Subject: [PATCH 5/9] Install swift-frontend executable --- tools/driver/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index aabba372ae647..1b3b06a637a9e 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -50,6 +50,9 @@ if(NOT SWIFT_BUILT_STANDALONE) endif() add_dependencies(compiler swift-frontend) +swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-frontend${CMAKE_EXECUTABLE_SUFFIX}" + DESTINATION "bin" + COMPONENT compiler) swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "bin" COMPONENT compiler) From 480c631209873682bc38fb746a54bbc2a475002d Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 19 Jun 2020 13:53:15 -0700 Subject: [PATCH 6/9] Linux-specific fixes for the swift-frontend rename. Hardlinking to a symlink is not permitted, so use "swift-frontend" instead of "swift" as the hard-link target. Also, update one Linux-specific test to check for swift-frontend. --- test/Driver/driver-compile.swift | 2 +- test/Driver/embed-bitcode.swift | 4 ++-- test/Driver/linker-autolink-extract.swift | 2 +- test/Driver/linker-clang_rt.swift | 2 +- test/Driver/linker.swift | 2 +- test/Driver/options-repl.swift | 2 +- test/Driver/subcommands.swift | 2 +- test/Driver/windows-link-job.swift | 2 +- test/lit.cfg | 2 ++ 9 files changed, 11 insertions(+), 9 deletions(-) diff --git a/test/Driver/driver-compile.swift b/test/Driver/driver-compile.swift index 8c5b17693393a..b8217f1ec1a16 100644 --- a/test/Driver/driver-compile.swift +++ b/test/Driver/driver-compile.swift @@ -46,7 +46,7 @@ // RUN: %swiftc_driver -driver-print-jobs -c -target x86_64-apple-macosx10.9 %s %S/../Inputs/empty.swift -module-name main -driver-filelist-threshold=0 2>&1 | %FileCheck -check-prefix=FILELIST %s // RUN: %empty-directory(%t)/DISTINCTIVE-PATH/usr/bin/ -// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t/DISTINCTIVE-PATH/usr/bin/swiftc) +// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/DISTINCTIVE-PATH/usr/bin/swiftc) // RUN: ln -s "swiftc" %t/DISTINCTIVE-PATH/usr/bin/swift-update // RUN: %t/DISTINCTIVE-PATH/usr/bin/swiftc -driver-print-jobs -c -update-code -target x86_64-apple-macosx10.9 %s 2>&1 > %t.upd.txt // RUN: %FileCheck -check-prefix UPDATE-CODE %s < %t.upd.txt diff --git a/test/Driver/embed-bitcode.swift b/test/Driver/embed-bitcode.swift index c1ced3bdbe4c9..1b21eedd0c01b 100644 --- a/test/Driver/embed-bitcode.swift +++ b/test/Driver/embed-bitcode.swift @@ -6,8 +6,8 @@ // CHECK-coff: "swiftc.{{exe}}", inputs: ["[[BC]]"], output: {object: "[[OBJECT:.*\.o]]"} // CHECK-coff: "clang.exe", inputs: ["[[OBJECT]]"], output: {image: "embed-bitcode"} -// CHECK-elf: "swift", inputs: ["{{.*}}embed-bitcode.swift"], output: {llvm-bc: "[[BC:.*\.bc]]"} -// CHECK-elf: "swift", inputs: ["[[BC]]"], output: {object: "[[OBJECT:.*\.o]]"} +// CHECK-elf: "swift-frontend", inputs: ["{{.*}}embed-bitcode.swift"], output: {llvm-bc: "[[BC:.*\.bc]]"} +// CHECK-elf: "swift-frontend", inputs: ["[[BC]]"], output: {object: "[[OBJECT:.*\.o]]"} // CHECK-elf: "swift-autolink-extract", inputs: ["[[OBJECT]]"], output: {autolink: "[[AUTOLINK:.*\.autolink]]"} // CHECK-elf: "clang", inputs: ["[[OBJECT]]", "[[AUTOLINK]]"], output: {image: "main"} diff --git a/test/Driver/linker-autolink-extract.swift b/test/Driver/linker-autolink-extract.swift index d689d057b679e..907607af0486d 100644 --- a/test/Driver/linker-autolink-extract.swift +++ b/test/Driver/linker-autolink-extract.swift @@ -5,7 +5,7 @@ // DEBUG_LINUX: bin/swift // DEBUG_LINUX-NEXT: bin/swift-autolink-extract // DEBUG_LINUX-NEXT: bin/swift -// DEBUG_LINUX-NEXT: bin/swift -modulewrap +// DEBUG_LINUX-NEXT: bin/swift-frontend -modulewrap // DEBUG_LINUX-NEXT: bin/clang{{"? }} // DEBUG_LINUX: -o main // DEBUG_LINUX-NOT: dsymutil diff --git a/test/Driver/linker-clang_rt.swift b/test/Driver/linker-clang_rt.swift index 7c8ad36805a54..1ffd9d2beb9b7 100644 --- a/test/Driver/linker-clang_rt.swift +++ b/test/Driver/linker-clang_rt.swift @@ -6,7 +6,7 @@ // RUN: rm -rf %t // RUN: %empty-directory(%t/bin) -// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t/bin/swiftc) +// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/bin/swiftc) // RUN: %empty-directory(%t/lib/swift/clang/lib/darwin/) // RUN: %t/bin/swiftc -driver-print-jobs -target x86_64-apple-macosx10.9 %S/../Inputs/empty.swift | %FileCheck -check-prefix CHECK -check-prefix CHECK-NO-RUNTIME %s diff --git a/test/Driver/linker.swift b/test/Driver/linker.swift index 88569da5b66d4..8235a07e96f54 100644 --- a/test/Driver/linker.swift +++ b/test/Driver/linker.swift @@ -415,7 +415,7 @@ // RUN: %empty-directory(%t/DISTINCTIVE-PATH/usr/bin) // RUN: touch %t/DISTINCTIVE-PATH/usr/bin/ld // RUN: chmod +x %t/DISTINCTIVE-PATH/usr/bin/ld -// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t/DISTINCTIVE-PATH/usr/bin/swiftc) +// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/DISTINCTIVE-PATH/usr/bin/swiftc) // RUN: %t/DISTINCTIVE-PATH/usr/bin/swiftc -target x86_64-apple-macosx10.9 %s -### | %FileCheck -check-prefix=RELATIVE-LINKER %s // RELATIVE-LINKER: {{/|\\\\}}DISTINCTIVE-PATH{{/|\\\\}}usr{{/|\\\\}}bin{{/|\\\\}}swift diff --git a/test/Driver/options-repl.swift b/test/Driver/options-repl.swift index d629a8c86d502..118ebd7b834f9 100644 --- a/test/Driver/options-repl.swift +++ b/test/Driver/options-repl.swift @@ -7,7 +7,7 @@ // RUN: %empty-directory(%t) // RUN: mkdir -p %t/usr/bin -// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t/usr/bin/swift) +// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/usr/bin/swift) // RUN: %t/usr/bin/swift -sdk "" -deprecated-integrated-repl -### | %FileCheck -check-prefix=INTEGRATED %s diff --git a/test/Driver/subcommands.swift b/test/Driver/subcommands.swift index 37801b83bb8df..14024c71579fb 100644 --- a/test/Driver/subcommands.swift +++ b/test/Driver/subcommands.swift @@ -3,7 +3,7 @@ // RUN: rm -rf %t.dir // RUN: mkdir -p %t.dir/usr/bin -// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t.dir/usr/bin/swift) +// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t.dir/usr/bin/swift) // RUN: %t.dir/usr/bin/swift -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s // RUN: %t.dir/usr/bin/swift repl -### 2>&1 | %FileCheck -check-prefix=CHECK-SWIFT-INVOKES-REPL %s diff --git a/test/Driver/windows-link-job.swift b/test/Driver/windows-link-job.swift index 34e7b292daad0..1f536f24dc5fc 100644 --- a/test/Driver/windows-link-job.swift +++ b/test/Driver/windows-link-job.swift @@ -1,4 +1,4 @@ // RUN: %empty-directory(%t/DISTINCTIVE-WINDOWS-PATH/usr/bin) -// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t/DISTINCTIVE-WINDOWS-PATH/usr/bin/swiftc) +// RUN: %hardlink-or-copy(from: %swift_frontend_plain, to: %t/DISTINCTIVE-WINDOWS-PATH/usr/bin/swiftc) // RUN: env PATH= %t/DISTINCTIVE-WINDOWS-PATH/usr/bin/swiftc -target x86_64-unknown-windows-msvc -### -module-name link -emit-library %s 2>&1 | %FileCheck %s // CHECK: {{^}}clang diff --git a/test/lit.cfg b/test/lit.cfg index c25cf5d481584..ba1eaa5104dc5 100644 --- a/test/lit.cfg +++ b/test/lit.cfg @@ -381,6 +381,8 @@ config.substitutions.append( ('%{python}', sys.executable) ) config.substitutions.append( ('%mcp_opt', mcp_opt) ) config.substitutions.append( ('%swift_driver_plain', "%r" % config.swift) ) config.substitutions.append( ('%swiftc_driver_plain', "%r" % config.swiftc) ) +config.substitutions.append( ('%swift_frontend_plain', "%r" % config.swift_frontend)) + if kIsWindows: config.substitutions.append( ('%swift_driver', "%r %s %s %s -libc %s" % (config.swift, mcp_opt, From 49dfa8fc986c2d5d664af86cfe92477df1ff0f10 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 19 Jun 2020 15:00:09 -0700 Subject: [PATCH 7/9] [Frontend rename] Fix another Linux test --- test/Driver/linker-args-order-linux.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Driver/linker-args-order-linux.swift b/test/Driver/linker-args-order-linux.swift index 380be7f4f28e3..9ee7a634c2c6d 100644 --- a/test/Driver/linker-args-order-linux.swift +++ b/test/Driver/linker-args-order-linux.swift @@ -4,6 +4,6 @@ print("hello world!") // RUN: %empty-directory(%t) // RUN: %target-swiftc_driver -driver-print-jobs -static-stdlib -o %t/static-stdlib %s -Xlinker --no-allow-multiple-definition 2>&1| %FileCheck %s -// CHECK: {{.*}}/swift -frontend -c -primary-file {{.*}}/linker-args-order-linux.swift +// CHECK: {{.*}}/swift-frontend -frontend -c -primary-file {{.*}}/linker-args-order-linux.swift // CHECK: {{.*}}/swift-autolink-extract{{.*}} // CHECK: {{.*}}swiftrt.o /{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.o @/{{.*}}/linker-args-order-linux-{{[a-z0-9]+}}.autolink {{.*}} @{{.*}}/static-stdlib-args.lnk {{.*}} -Xlinker --no-allow-multiple-definition From 9c4a189df6be584c2672661512185ab5151a6de8 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Fri, 19 Jun 2020 16:13:33 -0700 Subject: [PATCH 8/9] Disable test on Windows where we don't have symlinks --- test/Driver/frontend.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/test/Driver/frontend.swift b/test/Driver/frontend.swift index 2df7174e41c5e..f0ee617810814 100644 --- a/test/Driver/frontend.swift +++ b/test/Driver/frontend.swift @@ -1,4 +1,5 @@ // RUN: %swiftc_driver %s -### 2>&1 | %FileCheck %s +// UNSUPPORTED: windows // CHECK: swift-frontend From d49e4a218506746dc506c28f01ccb6a1fc1b36c5 Mon Sep 17 00:00:00 2001 From: Doug Gregor Date: Tue, 23 Jun 2020 14:13:51 -0700 Subject: [PATCH 9/9] [Build] Don't install swift-frontend twice, incorrectly --- tools/driver/CMakeLists.txt | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt index 1b3b06a637a9e..aabba372ae647 100644 --- a/tools/driver/CMakeLists.txt +++ b/tools/driver/CMakeLists.txt @@ -50,9 +50,6 @@ if(NOT SWIFT_BUILT_STANDALONE) endif() add_dependencies(compiler swift-frontend) -swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift-frontend${CMAKE_EXECUTABLE_SUFFIX}" - DESTINATION "bin" - COMPONENT compiler) swift_install_in_component(FILES "${SWIFT_RUNTIME_OUTPUT_INTDIR}/swift${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION "bin" COMPONENT compiler)