Skip to content

Commit 59fe82a

Browse files
authored
Merge pull request #33638 from nkcsgexi/test-use-interface-for-module
[test] ABIChecker: add a test for -use-interface-for-module flag
2 parents e387b36 + 8f72547 commit 59fe82a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// REQUIRES: VENDOR=apple
2+
3+
// RUN: %empty-directory(%t.mod)
4+
// RUN: %empty-directory(%t.sdk)
5+
// RUN: %empty-directory(%t.module-cache)
6+
7+
// RUN: echo "public func foo() {}" > %t.swift
8+
9+
// RUN: %target-swift-frontend -emit-module -emit-module-interface-path %t.mod/cake.swiftinterface %t.swift %clang-importer-sdk-nosource -parse-as-library -enable-library-evolution -disable-objc-attr-requires-foundation-module -module-cache-path %t.module-cache -emit-module-path %t.mod/cake.swiftmodule -module-name cake -swift-version 5
10+
11+
// Step 1: we should be able to load if we prefer cake.swiftinterface
12+
// RUN: %api-digester -dump-sdk -print-module -module cake -I %t.mod -sdk %clang-importer-sdk-path -module-cache-path %t.module-cache -o %t.json -abi -abort-on-module-fail -use-interface-for-module cake
13+
14+
// RUN: echo "Swift Syntax Error" >> %t.mod/cake.swiftinterface
15+
16+
// Step 2: we shouldn't be able to load if we prefer cake.swiftinterface and cake.swiftinterface is broken
17+
// RUN: not %api-digester -dump-sdk -print-module -module cake -I %t.mod -sdk %clang-importer-sdk-path -module-cache-path %t.module-cache -o %t.json -abi -abort-on-module-fail -use-interface-for-module cake
18+
19+
// Step 3: we should be able to load if we don't prefer cake.swiftinterface
20+
// RUN: %api-digester -dump-sdk -print-module -module cake -I %t.mod -sdk %clang-importer-sdk-path -module-cache-path %t.module-cache -o %t.json -abi -abort-on-module-fail

0 commit comments

Comments
 (0)