Skip to content

Commit a84f6ec

Browse files
authored
Merge pull request #25013 from mikeash/swift-5.1-branch
[Test] Fix crash_without_backtrace_optimized.swift.
2 parents d98aeaf + 4579331 commit a84f6ec

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/Runtime/crash_without_backtrace_optimized.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,21 @@
2323

2424
import Swift
2525

26+
#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
27+
import Darwin
28+
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
29+
import Glibc
30+
#elseif os(Windows)
31+
import MSVCRT
32+
#else
33+
#error("Unsupported platform")
34+
#endif
35+
2636
func foo() -> Int {
2737
return UnsafePointer<Int>(bitPattern: 0)!.pointee
2838
}
2939

40+
// Give FileCheck something to look at to keep it happy. It fails on
41+
// empty output even if the only directive is a CHECK-NOT.
42+
fputs("Running test.\n", stderr)
3043
foo()

0 commit comments

Comments
 (0)