Skip to content

Commit 005a040

Browse files
committed
[5.9] Allow simulator tests on Apple Silicon
Some of the conditions in lit.cfg assume a simulator always targets Intel, but this is not true after the introduction of Apple Silicon. Rely instead on `run_environment`. Addresses rdar://109040191 (cherry picked from commit 2c91c54)
1 parent 65e6402 commit 005a040

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/lit.cfg

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -916,8 +916,8 @@ if run_os in ('maccatalyst',):
916916
target_os_abi = 'macosx'
917917
target_os_is_maccatalyst = "TRUE"
918918
config.available_features.add("OS=ios")
919-
# macOS on ASi uses the stable ABI
920-
if run_os in ('macosx',) and run_cpu in ('arm64',):
919+
# macOS and simulators on ASi use the stable ABI
920+
if (run_os in ('macosx',) or 'simulator' in run_environment) and run_cpu in ('arm64',):
921921
target_mandates_stable_abi = "TRUE"
922922
config.available_features.add('swift_only_stable_abi')
923923
if run_os in (
@@ -1154,13 +1154,13 @@ if run_vendor == 'apple':
11541154
target_future_version = ''
11551155

11561156
# Only permit non-executable tests for ARM on Darwin unless you are on macOS
1157-
if 'arm' in run_cpu and run_os not in ('macosx',):
1157+
if 'simulator' not in run_environment and run_os not in ('macosx',):
11581158
if swift_test_mode != 'only_non_executable':
11591159
raise RuntimeError('Device tests are currently only supported when '
11601160
'the swift_test_mode is "only_non_executable". Current '
11611161
'swift_test_mode is {}.'.format(swift_test_mode))
11621162

1163-
if 'arm' in run_cpu and not (run_os == 'macosx' or run_os == 'maccatalyst'):
1163+
if 'simulator' not in run_environment and not (run_os == 'macosx' or run_os == 'maccatalyst'):
11641164
# iOS/tvOS/watchOS device
11651165
if run_os == 'ios':
11661166
lit_config.note('Testing iOS ' + config.variant_triple)
@@ -1199,7 +1199,7 @@ if run_vendor == 'apple':
11991199
(sw_vers_name, sw_vers_vers, sw_vers_build) = \
12001200
darwin_get_sdk_version(config.variant_sdk)
12011201

1202-
elif run_os == 'ios' or run_os == 'tvos' or run_os == 'watchos':
1202+
elif 'simulator' in run_environment:
12031203
# iOS/tvOS/watchOS simulator
12041204
if run_os == 'ios':
12051205
config.available_features.add('DARWIN_SIMULATOR=ios')

0 commit comments

Comments
 (0)