Skip to content

Commit

Permalink
Merge pull request swiftlang#25017 from mikeash/fix-crash-without-bac…
Browse files Browse the repository at this point in the history
…ktrace-optimized2

[Test] Use --allow-empty in crash_without_backtrace_optimized.swift.
  • Loading branch information
mikeash authored May 28, 2019
2 parents 44f0e93 + 20b24c5 commit ef069a3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
4 changes: 1 addition & 3 deletions test/Runtime/crash_without_backtrace.swift
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift %s -o %t/out
// RUN: %{python} %S/../Inputs/not.py "%target-run %t/out" 2>&1 | %FileCheck %s
// RUN: %{python} %S/../Inputs/not.py "%target-run %t/out" 2>&1 | %FileCheck --allow-empty %s

// NOTE: not.py is used above instead of "not --crash" because %target-run
// doesn't pass through the crash, and `not` may not be available when running
// on a remote host.

// REQUIRES: rdar51076215

// UNSUPPORTED: OS=watchos
// UNSUPPORTED: OS=ios
// UNSUPPORTED: OS=tvos
Expand Down
15 changes: 1 addition & 14 deletions test/Runtime/crash_without_backtrace_optimized.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -O %s -o %t/out
// RUN: %{python} %S/../Inputs/not.py "%target-run %t/out" 2>&1 | %FileCheck %s
// RUN: %{python} %S/../Inputs/not.py "%target-run %t/out" 2>&1 | %FileCheck --allow-empty %s

// NOTE: not.py is used above instead of "not --crash" because %target-run
// doesn't pass through the crash, and `not` may not be available when running
Expand All @@ -23,21 +23,8 @@

import Swift

#if os(macOS) || os(iOS) || os(tvOS) || os(watchOS)
import Darwin
#elseif os(Linux) || os(FreeBSD) || os(PS4) || os(Android) || os(Cygwin) || os(Haiku)
import Glibc
#elseif os(Windows)
import MSVCRT
#else
#error("Unsupported platform")
#endif

func foo() -> Int {
return UnsafePointer<Int>(bitPattern: 0)!.pointee
}

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

0 comments on commit ef069a3

Please sign in to comment.