Files
swift-mirror/test/Driver/options-repl-darwin.swift
Jordan Rose 19e09c7b3e [Driver] Don't pass a target triple to the REPL or immediate mode. (#6430)
LLDB will automatically pick the host OS if no target is passed; a
later commit will teach immediate mode to do the same thing. For now,
they default to the same triple the Driver did in the past, which is
x86_64-apple-macosx10.9 on macOS and an arbitrary unversioned triple
compatible with the host elsewhere.

Part of rdar://problem/29433205.
2016-12-21 12:54:56 -08:00

34 lines
1.2 KiB
Swift

// REQUIRES: OS=macosx
// Test LLDB detection, first in a clean environment, then in one that looks
// like the Xcode installation environment. We use hard links to make sure
// the Swift driver really thinks it's been moved.
// RUN: rm -rf %t
// RUN: mkdir -p %t/usr/bin/
// RUN: %hardlink-or-copy(from: %swift_driver_plain, to: %t/usr/bin/swift)
// RUN: %t/usr/bin/swift -repl -### | %FileCheck -check-prefix=INTEGRATED %s
// RUN: %t/usr/bin/swift -### | %FileCheck -check-prefix=INTEGRATED %s
// RUN: touch %t/usr/bin/lldb
// RUN: chmod +x %t/usr/bin/lldb
// RUN: %t/usr/bin/swift -repl -### | %FileCheck -check-prefix=LLDB %s
// RUN: %t/usr/bin/swift -### | %FileCheck -check-prefix=LLDB %s
// RUN: mkdir -p %t/Toolchains/Test.xctoolchain/usr/bin/
// RUN: mv %t/usr/bin/swift %t/Toolchains/Test.xctoolchain/usr/bin/swift
// RUN: %t/Toolchains/Test.xctoolchain/usr/bin/swift -repl -### | %FileCheck -check-prefix=LLDB %s
// Clean up the test executable because hard links are expensive.
// RUN: rm -rf %t/Toolchains/Test.xctoolchain/usr/bin/swift
// INTEGRATED: swift -frontend -repl
// INTEGRATED: -module-name REPL
// LLDB: lldb{{"?}} "--repl=
// LLDB-NOT: -module-name
// LLDB-NOT: -target
// LLDB: "