Skip to content

When running with the interpreter on Darwin, force the usage of the just built, stdlib when running the frontend. #37771

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/Interpreter/process_arguments.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %swift -interpret %s | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %swift -interpret %s -Onone -g | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %swift -interpret %s -Onone -g -- | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %swift -interpret %s -Onone -g -- a b c | %FileCheck %s -check-prefix=CHECK-THREE
// RUN: %target-jit-run -interpret %s | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %target-jit-run -interpret %s -Onone -g | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %target-jit-run -interpret %s -Onone -g -- | %FileCheck %s -check-prefix=CHECK-NONE
// RUN: %target-jit-run -interpret %s -Onone -g -- a b c | %FileCheck %s -check-prefix=CHECK-THREE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can drop -interpret

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Touche.


// REQUIRES: swift_interpreter

Expand Down
2 changes: 1 addition & 1 deletion test/Interpreter/protocol_lookup_jit.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Test protocol_lookup.swift in JIT mode.
// RUN: %swift -interpret %S/protocol_lookup.swift | %FileCheck %S/protocol_lookup.swift
// RUN: %target-jit-run %S/protocol_lookup.swift | %FileCheck %S/protocol_lookup.swift
// REQUIRES: executable_test

// REQUIRES: swift_interpreter
Expand Down
5 changes: 3 additions & 2 deletions test/Serialization/operator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_operator.swift
// RUN: llvm-bcanalyzer %t/def_operator.swiftmodule | %FileCheck %s
// RUN: %target-swift-frontend -typecheck -I%t %s
// RUN: %target-swift-frontend -interpret -I %t -DINTERP %s | %FileCheck --check-prefix=OUTPUT %s

//
// Run with the interpreter using the proper filecheck pattern.
// RUN: %target-jit-run -I %t -DINTERP %s | %FileCheck --check-prefix=OUTPUT %s
// REQUIRES: swift_interpreter

// FIXME: iOS doesn't work because this test needs the interpreter to handle
Expand Down
29 changes: 19 additions & 10 deletions test/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ if lit_config.params.get('disable_unittests', None) is not None:
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)

# test_exec_root: The root path where tests should be run.
# swift_obj_root: The path to the swift build root.
swift_obj_root = getattr(config, 'swift_obj_root', None)

# cmake. The path to the cmake executable we used to configure swift.
Expand Down Expand Up @@ -1799,12 +1799,6 @@ if sftp_server_path:
config.substitutions.append(('%sftp-server',
sftp_server_path or 'no-sftp-server'))

subst_target_jit_run = ""
if 'swift_interpreter' in config.available_features:
subst_target_jit_run = (
"%s -interpret %s" %
(config.target_swift_frontend, sdk_overlay_link_path))

subst_target_repl_run_simple_swift = ""
if 'swift_repl' in config.available_features:
subst_target_repl_run_simple_swift = (
Expand Down Expand Up @@ -1891,6 +1885,17 @@ if not kIsWindows:
"SIMCTL_CHILD_DYLD_LIBRARY_PATH='{0}' " # Simulator option
.format(all_stdlib_path, libdispatch_path)) + config.target_run

subst_target_jit_prefix = ""
if platform.system() == 'Darwin' and config.target_run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At one point you had a big comment about why this was needed; it would be nice to resurrect that.

subst_target_jit_prefix = config.target_run

subst_target_jit_run = ""
if 'swift_interpreter' in config.available_features:
subst_target_jit_run = (
"%s %s -interpret %s" %
(subst_target_jit_prefix,
config.target_swift_frontend, sdk_overlay_link_path))

if not getattr(config, 'target_run_simple_swift', None):
config.target_run_simple_swift_parameterized = SubstituteCaptures(
r"%%empty-directory(%%t) && "
Expand Down Expand Up @@ -2080,10 +2085,14 @@ config.substitutions.append(('%target-swift-reflection-test', config.target_swif

config.substitutions.append(('%target-swift-reflection-dump', '{} {} {}'.format(config.swift_reflection_dump, '-arch', run_cpu)))
config.substitutions.append(('%target-swiftc_driver', config.target_swiftc_driver))

config.substitutions.append(('%target-swift-remoteast-test-with-sdk',
'%s -sdk %r' %
(config.swift_remoteast_test, config.variant_sdk)))
config.substitutions.append(('%target-swift-remoteast-test', config.swift_remoteast_test))
'%s %s -sdk %r' %
(subst_target_jit_prefix,
config.swift_remoteast_test, config.variant_sdk)))
config.substitutions.append(('%target-swift-remoteast-test',
'%s %s' % (subst_target_jit_prefix,
config.swift_remoteast_test)))

if hasattr(config, 'target_swift_autolink_extract'):
config.available_features.add('autolink-extract')
Expand Down