[AutoDiff] Add SR-12526 negative test.

Add negative test for SR-12526: `@derivative` attribute cross-module
deserialization crash.
This commit is contained in:
Dan Zheng
2020-04-06 02:24:09 -07:00
parent 0c1d4b5adf
commit 52b771dfe4
3 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module -primary-file %S/Inputs/a.swift -emit-module-path %t/a.swiftmodule
// RUN: %target-swift-frontend -emit-module -primary-file %S/Inputs/b.swift -emit-module-path %t/b.swiftmodule -I %t
// RUN: not --crash %target-swift-frontend-typecheck -verify -I %t %s
// SR-12526: Fix cross-module deserialization crash involving `@derivative` attribute.
import a
import b
func foo(_ s: Struct) {
_ = Struct()
_ = s.method(1)
}