Skip to content

Commit fcb51dc

Browse files
committed
[windows] XFAIL crash-in-user-code test in MSVC 2017
See also #33383 where this problem is better explained. MSVC doesn't seem to trigger the exception code when no frame pointers are generated. The only thing missing would be for interpreted code to have a more informative crash message. Add a new LLVM Lit feature with the value of the VisualStudioVersion environment variable (it seems to not change even for minor versions, so it is an easy way to figure out the 2017/2019 difference, even if updates are applied). Use the new feature in a XFAIL check in the test.
1 parent 48b73fd commit fcb51dc

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

test/Frontend/crash-in-user-code.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// UNSUPPORTED: OS=tvos
99
// UNSUPPORTED: OS=watchos
1010

11+
// XFAIL: MSVC_VER=15.0
12+
1113
// CHECK: Stack dump:
1214
// CHECK-NEXT: Program arguments:
1315
// CHECK-NEXT: Swift version

test/lit.cfg

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2018,8 +2018,6 @@ if copy_env is not None:
20182018
for key in copy_env.split(':'):
20192019
config.environment[key] = os.environ[key]
20202020

2021-
lit_config.note("Available features: " + ", ".join(sorted(config.available_features)))
2022-
20232021
# On macOS reflection information is read through the dyld APIs
20242022
# On other platorms, this information is exported through extra
20252023
# entry points in the Swift runtime that are only available in debug builds.
@@ -2040,3 +2038,9 @@ if kIsWindows:
20402038
config.substitutions.append( ('%diff', 'diff --strip-trailing-cr') )
20412039
else:
20422040
config.substitutions.append( ('%diff', 'diff') )
2041+
2042+
visual_studio_version = os.environ.get('VisualStudioVersion')
2043+
if kIsWindows and visual_studio_version:
2044+
config.available_features.add('MSVC_VER=%s' % visual_studio_version)
2045+
2046+
lit_config.note("Available features: " + ", ".join(sorted(config.available_features)))

0 commit comments

Comments
 (0)