|
8 | 8 | //
|
9 | 9 | // We then modify LeafModule.swiftinterface to have an error in it, and check that we get a diagnostic and failure.
|
10 | 10 | //
|
| 11 | +// We then modify LeafModule.swiftinterface to have an error in an @inlinable function body, and check we get a diagnostic and failure. |
11 | 12 | //
|
12 | 13 | // Setup phase 1: Write input files.
|
13 | 14 | //
|
|
32 | 33 | //
|
33 | 34 | // RUN: %{python} %S/Inputs/check-is-old.py %t/OtherModule.swiftinterface %t/LeafModule.swiftinterface
|
34 | 35 | // RUN: %{python} %S/Inputs/check-is-old.py %t/modulecache/OtherModule-*.swiftmodule %t/modulecache/LeafModule-*.swiftmodule
|
| 36 | +// RUN: cp %t/LeafModule.swiftinterface %t/LeafModule.swiftinterface.backup |
35 | 37 | // RUN: echo "@inlinable func foo() { var x = 10 }" >>%t/LeafModule.swiftinterface
|
36 | 38 | // RUN: %{python} %S/Inputs/make-old.py %t/LeafModule.swiftinterface
|
37 | 39 | // RUN: %{python} %S/Inputs/check-is-old.py %t/LeafModule.swiftinterface
|
|
65 | 67 | // RUN: not %target-swift-frontend -I %t -module-cache-path %t/modulecache -serialize-diagnostics -serialize-diagnostics-path %t/err.dia -enable-parseable-module-interface -emit-module -o %t/TestModule.swiftmodule -module-name TestModule %s
|
66 | 68 | // RUN: %{python} %S/Inputs/check-is-old.py %t/modulecache/OtherModule-*.swiftmodule %t/modulecache/LeafModule-*.swiftmodule
|
67 | 69 | // RUN: c-index-test -read-diagnostics %t/err.dia 2>&1 | %FileCheck %s -check-prefix=CHECK-ERROR
|
| 70 | +// |
| 71 | +// |
| 72 | +// Next test: add an inlinable function body with an unresolved identifier to LeafModule.swiftinterface; check we do not get a rebuild and report the additional error correctly. |
| 73 | +// |
| 74 | +// RUN: mv %t/LeafModule.swiftinterface.backup %t/LeafModule.swiftinterface |
| 75 | +// RUN: echo "@inlinable func bar() { var x = unresolved }" >>%t/LeafModule.swiftinterface |
| 76 | +// RUN: %{python} %S/Inputs/make-old.py %t/LeafModule.swiftinterface |
| 77 | +// RUN: %{python} %S/Inputs/check-is-old.py %t/OtherModule.swiftinterface %t/LeafModule.swiftinterface |
| 78 | +// RUN: %{python} %S/Inputs/check-is-old.py %t/modulecache/OtherModule-*.swiftmodule %t/modulecache/LeafModule-*.swiftmodule |
| 79 | +// RUN: not %target-swift-frontend -I %t -module-cache-path %t/modulecache -enable-parseable-module-interface -emit-module -o %t/TestModule.swiftmodule -module-name TestModule %s >%t/err-inline.txt 2>&1 |
| 80 | +// RUN: %{python} %S/Inputs/check-is-old.py %t/modulecache/OtherModule-*.swiftmodule %t/modulecache/LeafModule-*.swiftmodule |
| 81 | +// RUN: %FileCheck %s -check-prefix=CHECK-ERROR-INLINE <%t/err-inline.txt |
| 82 | +// CHECK-ERROR-INLINE: LeafModule.swiftinterface:6:33: error: use of unresolved identifier 'unresolved' |
| 83 | +// CHECK-ERROR-INLINE: OtherModule.swiftinterface:4:8: error: no such module 'LeafModule' |
| 84 | +// |
| 85 | +// |
| 86 | +// Next test: same as above, but with a .dia file |
| 87 | +// |
| 88 | +// RUN: %{python} %S/Inputs/check-is-old.py %t/OtherModule.swiftinterface %t/LeafModule.swiftinterface |
| 89 | +// RUN: %{python} %S/Inputs/check-is-old.py %t/modulecache/OtherModule-*.swiftmodule %t/modulecache/LeafModule-*.swiftmodule |
| 90 | +// RUN: not %target-swift-frontend -I %t -module-cache-path %t/modulecache -serialize-diagnostics -serialize-diagnostics-path %t/err-inline.dia -enable-parseable-module-interface -emit-module -o %t/TestModule.swiftmodule -module-name TestModule %s |
| 91 | +// RUN: %{python} %S/Inputs/check-is-old.py %t/modulecache/OtherModule-*.swiftmodule %t/modulecache/LeafModule-*.swiftmodule |
| 92 | +// RUN: c-index-test -read-diagnostics %t/err-inline.dia 2>&1 | %FileCheck %s -check-prefix=CHECK-ERROR-INLINE |
68 | 93 |
|
69 | 94 | import OtherModule
|
70 | 95 |
|
|
0 commit comments