Files
swift-mirror/test/Driver/LegacyDriver/legacy-driver-propagates-response-file-to-new-driver.swift
Daniel Rodríguez Troitiño 8f0382c109 [test] Replace swift_obj_root for alternates that work in LLVM unified builds (#66167)
In LLVM unified builds `%swift_obj_root` points to `<LLVM build dir>/tools/swift`,
and folders like `bin`, `lib` and `share` are not under `swift_obj_root`, which
makes some tests fail.

For the cases in which `%swift_obj_root/lib` was used, replace it by
using `%swift-lib-dir` instead. Replicate `%swift-lib-dir` to create
`%swift-bin-dir` and `%swift-share-dir`, and use those instead of
`%swift_obj_root/bin` and `%swift_obj_root/share`.

This alternates work both in Swift build-script builds and also in LLVM
unified builds.
2023-05-26 08:39:31 -07:00

18 lines
858 B
Swift

// Verify that when the legacy driver (swift-frontend executable invoked as
// swiftc) spawns the new driver, it passes the original arguments (i.e.,
// preserving response files) instead of trying to spawn the process with the
// expansion, which may exceed `ARG_MAX`.
// REQUIRES: shell
// RUN: %{python} -c 'for i in range(500001): print("-DTEST5_" + str(i))' > %t.resp
// RUN: cp %S/Inputs/print-args.sh %swift-bin-dir/legacy-driver-propagates-response-file.sh
// RUN: env SWIFT_USE_NEW_DRIVER=legacy-driver-propagates-response-file.sh %swiftc_driver_plain %s @%t.resp | %FileCheck %s
// RUN: rm %swift-bin-dir/legacy-driver-propagates-response-file.sh
// CHECK: -Xfrontend
// CHECK-NEXT: -new-driver-path
// CHECK-NEXT: -Xfrontend
// CHECK-NEXT: legacy-driver-propagates-response-file.sh
// CHECK: @{{.*}}.resp
// CHECK-NOT: -DTEST5_{{.*}}