Skip to content

Commit bdbcec6

Browse files
committed
[Test] Specialize Prototypes/BigInt.swift for Windows.
Building the file with asserts crashes the compiler. Building the file with no_asserts does *not* crash the compiler. For non-Windows platforms, it is sufficient to `XFAIL: asserts`. That does not work on Windows thanks to Python < 3: the crash is not handled by lit's `not` there as it is on other platforms. To handle the expected crash on Windows when building with asserts, not --crash is required. However on other platforms, not --crash breaks the test in no_asserts builds. Here, a version of the test's run script specialized for Windows is broken out into a separate BigInt-windows.swift file. rdar://problem/65251059
1 parent ee0955a commit bdbcec6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

test/Prototypes/BigInt-windows.swift

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// This test is intentionally specialized on windows because `not --crash`
2+
// behaves differently there: the exit code from the crashing frontend
3+
// invocations is mapped to `-21` there, which lit's `not` along does not remap
4+
// correctly.
5+
// See rdar://problem/65251059
6+
// REQUIRES: OS=windows-msvc
7+
8+
// RUN: %empty-directory(%t)
9+
// RUN: not --crash %target-build-swift -swift-version 4 -o %t/a.out %S/BigInt.swift
10+
// RUN: %target-run %t/a.out
11+
// REQUIRES: executable_test
12+
// REQUIRES: CPU=x86_64
13+
// XFAIL: asserts

test/Prototypes/BigInt.swift

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
// RUN: %empty-directory(%t)
14-
// RUN: not --crash %target-build-swift -swift-version 4 -o %t/a.out %s
14+
// RUN: %target-build-swift -swift-version 4 -o %t/a.out %s
1515
// RUN: %target-run %t/a.out
1616
// REQUIRES: executable_test
1717
// REQUIRES: CPU=x86_64
1818

19-
// REQUIRES: rdar65251059
19+
// See rdar://problem/65251059
20+
// UNSUPPORTED: windows
2021
// rdar://problem/65015626
2122
// XFAIL: asserts
2223

0 commit comments

Comments
 (0)