|
7 | 7 |
|
8 | 8 | // RUN: %empty-directory(%t)
|
9 | 9 |
|
10 |
| -// RUN: %target-build-swift-dylib(%t/%target-library-name(mysimd)) -enable-library-evolution %S/../Inputs/polymorphic_builtins.swift -emit-module -emit-module-path %t/mysimd.swiftmodule -module-name mysimd -parse-stdlib |
| 10 | +// RUN: %target-build-swift-dylib(%t/%target-library-name(mysimd)) -enable-library-evolution %S/../Inputs/polymorphic_builtins.swift -emit-module -emit-module-path %t/mysimd.swiftmodule -module-name mysimd -parse-stdlib -D DEBUG -Onone |
11 | 11 | // RUN: %target-codesign %t/%target-library-name(mysimd)
|
12 | 12 |
|
13 |
| -// RUN: %target-build-swift %s -L %t -I %t -lmysimd -parse-stdlib -Xfrontend -disable-access-control -Xfrontend -sil-verify-all %target-rpath(%t) -o %t/a.out |
| 13 | +// RUN: %target-build-swift %s -L %t -I %t -lmysimd -parse-stdlib -Xfrontend -disable-access-control -Xfrontend -sil-verify-all %target-rpath(%t) -o %t/a.out -D DEBUG -Onone |
14 | 14 | // RUN: %target-codesign %t/a.out
|
15 | 15 |
|
16 | 16 | // RUN: %target-run %t/a.out %t/%target-library-name(mysimd)
|
17 | 17 |
|
18 |
| -// REQUIRES: executable_test |
| 18 | +// RUN: %empty-directory(%t) |
19 | 19 |
|
20 |
| -// TODO: Re-enable this when optimization is enabled. |
21 |
| -// |
22 |
| -// REQUIRES: swift_test_mode_optimize_none |
| 20 | +// RUN: %target-build-swift-dylib(%t/%target-library-name(mysimd)) -enable-library-evolution %S/../Inputs/polymorphic_builtins.swift -emit-module -emit-module-path %t/mysimd.swiftmodule -module-name mysimd -parse-stdlib -O |
| 21 | +// RUN: %target-codesign %t/%target-library-name(mysimd) |
| 22 | + |
| 23 | +// RUN: %target-build-swift %s -L %t -I %t -lmysimd -parse-stdlib -Xfrontend -disable-access-control -Xfrontend -sil-verify-all %target-rpath(%t) -o %t/a.out -O |
| 24 | +// RUN: %target-codesign %t/a.out |
| 25 | + |
| 26 | +// RUN: %target-run %t/a.out %t/%target-library-name(mysimd) |
| 27 | + |
| 28 | +// REQUIRES: executable_test |
23 | 29 |
|
24 | 30 | import Swift
|
25 | 31 | import StdlibUnittest
|
@@ -86,12 +92,16 @@ Tests.test("Indirect Dispatch + Transparent + _isConcrete Guard == OK") {
|
86 | 92 | }
|
87 | 93 |
|
88 | 94 | // In this case, we call mul which is unguarded with _isConcrete and thus
|
89 |
| -// crashes. The stdlib maintainer should have guarded this usage to ensure that |
90 |
| -// we did not go down this code path. |
| 95 | +// crashes in Debug, but in Release we (after inlining/specialization) /do/ |
| 96 | +// succeed. This is one reason why _isConcrete is needed. |
| 97 | +// |
| 98 | +// The stdlib maintainer should have guarded this usage to ensure that we did |
| 99 | +// not go down this code path. |
91 | 100 |
|
92 |
| -Tests.test("Indirect Dispatch + Transparent + No _isConcrete Guard == Crash") { |
| 101 | +Tests.test("Indirect Dispatch + Transparent + No _isConcrete Guard == Crash when Debug") { |
| 102 | +#if DEBUG |
93 | 103 | expectCrashLater()
|
94 |
| - |
| 104 | +#endif |
95 | 105 | let inputs: [Int32] = [5,6,7,8]
|
96 | 106 | let expectedOutputs: [Int32] = inputs.map { $0 &* $0 }
|
97 | 107 |
|
|
0 commit comments