|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: %target-clang -x c -c %S/Inputs/unbuffered-putchar.c -o %t/unbuffered-putchar.o |
| 3 | + |
| 4 | +// RUN: %target-build-swift -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none %s -Xlinker %t/unbuffered-putchar.o -o %t/a.out |
| 5 | +// RUN: not --crash %t/a.out 2>&1 | %FileCheck %s --check-prefix=CHECK-MESSAGE |
| 6 | + |
| 7 | +// RUN: %target-build-swift -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none %s -Xlinker %t/unbuffered-putchar.o -o %t/a.out -O |
| 8 | +// RUN: not --crash %t/a.out 2>&1 | %FileCheck %s --check-prefix=CHECK-NOMESSAGE |
| 9 | + |
| 10 | +// RUN: %target-build-swift -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none %s -Xlinker %t/unbuffered-putchar.o -o %t/a.out -Osize |
| 11 | +// RUN: not --crash %t/a.out 2>&1 | %FileCheck %s --check-prefix=CHECK-NOMESSAGE |
| 12 | + |
| 13 | +// RUN: %target-build-swift -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none %s -Xlinker %t/unbuffered-putchar.o -o %t/a.out -O -assert-config Debug |
| 14 | +// RUN: not --crash %t/a.out 2>&1 | %FileCheck %s --check-prefix=CHECK-MESSAGE |
| 15 | + |
| 16 | +// RUN: %target-build-swift -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none %s -Xlinker %t/unbuffered-putchar.o -o %t/a.out -Osize -assert-config Debug |
| 17 | +// RUN: not --crash %t/a.out 2>&1 | %FileCheck %s --check-prefix=CHECK-MESSAGE |
| 18 | + |
| 19 | +// REQUIRES: swift_in_compiler |
| 20 | +// REQUIRES: executable_test |
| 21 | +// REQUIRES: optimized_stdlib |
| 22 | +// REQUIRES: OS=macosx || OS=linux-gnu |
| 23 | +// REQUIRES: swift_test_mode_optimize_none |
| 24 | +// REQUIRES: swift_feature_Embedded |
| 25 | + |
| 26 | +func testWithInterpolation(i: Int) { |
| 27 | + fatalError("task failed successfully \(i)") |
| 28 | + // CHECK-MESSAGE: {{.*}}/traps-fatalerror-exec2.swift:[[@LINE-1]]: Fatal error: task failed successfully 42 |
| 29 | + // CHECK-NOMESSAGE-NOT: Fatal error |
| 30 | + // CHECK-NOMESSAGE-NOT: task failed successfully 42 |
| 31 | +} |
| 32 | + |
| 33 | +testWithInterpolation(i: 42) |
0 commit comments