     XCTAssertEqual(driver5.args, ["swift", "-repl"])
 
     let driver6 = try Driver.invocationRunMode(forArgs: ["swift", "foo", "bar"])
-    XCTAssertEqual(driver6.mode, .subcommand("swift-foo"))
-    XCTAssertEqual(driver6.args, ["swift-foo", "bar"])
+    XCTAssertEqual(driver6.mode, .subcommand(executableName("swift-foo")))
+    XCTAssertEqual(driver6.args, [executableName("swift-foo"), "bar"])
 
     let driver7 = try Driver.invocationRunMode(forArgs: ["swift", "-frontend", "foo", "bar"])
-    XCTAssertEqual(driver7.mode, .subcommand("swift-frontend"))
-    XCTAssertEqual(driver7.args, ["swift-frontend", "foo", "bar"])
+    XCTAssertEqual(driver7.mode, .subcommand(executableName("swift-frontend")))
+    XCTAssertEqual(driver7.args, [executableName("swift-frontend"), "foo", "bar"])
 
     let driver8 = try Driver.invocationRunMode(forArgs: ["swift", "-modulewrap", "foo", "bar"])
-    XCTAssertEqual(driver8.mode, .subcommand("swift-frontend"))
-    XCTAssertEqual(driver8.args, ["swift-frontend", "-modulewrap", "foo", "bar"])
+    XCTAssertEqual(driver8.mode, .subcommand(executableName("swift-frontend")))
+    XCTAssertEqual(driver8.args, [executableName("swift-frontend"), "-modulewrap", "foo", "bar"])
   }
 
   func testSubcommandsHandling() throws {

        XCTAssertFalse(plannedJobs.map { $0.kind }.contains(.generateDSYM))
      }

      XCTAssertTrue(cmd.contains(.path(try VirtualPath(path: "Test"))))
    }

    do {

    XCTAssertEqual(output,
    """
    digraph Jobs {
      "emitModule (\(executableName("swift-frontend")))" [style=bold];
      "test.swift" [fontsize=12];
      "test.swift" -> "emitModule (\(executableName("swift-frontend")))" [color=blue];
      "test.swiftmodule" [fontsize=12];
      "emitModule (\(executableName("swift-frontend")))" -> "test.swiftmodule" [color=green];
      "test.swiftdoc" [fontsize=12];
      "emitModule (\(executableName("swift-frontend")))" -> "test.swiftdoc" [color=green];
      "test.abi.json" [fontsize=12];
      "emitModule (\(executableName("swift-frontend")))" -> "test.abi.json" [color=green];
      "compile (\(executableName("swift-frontend")))" [style=bold];
      "test.swift" -> "compile (\(executableName("swift-frontend")))" [color=blue];
      "test-1.o" [fontsize=12];
      "compile (\(executableName("swift-frontend")))" -> "test-1.o" [color=green];
      "link (\(linkerDriver))" [style=bold];
      "test-1.o" -> "link (\(linkerDriver))" [color=blue];
      "\(executableName("test"))" [fontsize=12];
      "link (\(linkerDriver))" -> "\(executableName("test"))" [color=green];
    }

    """)
