swift-symbolgraph-extract: Fix -target inference test.

Only test `-target` inference in CI configurations that are not
cross-compiling.

Resolves rdar://156991775.
This commit is contained in:
Allan Shortlidge
2025-07-29 16:37:41 -07:00
parent cda069f419
commit f5b67e2495
2 changed files with 19 additions and 5 deletions

View File

@@ -4,11 +4,6 @@
// RUN: %target-swift-symbolgraph-extract -module-name Basic -I %t -pretty-print -output-dir %t/Output
// RUN: %FileCheck %s --input-file %t/Output/Basic.symbols.json
// Verify that -target can be inferred
// RUN: %empty-directory(%t/Output)
// RUN: %swift-symbolgraph-extract -module-name Basic -I %t -pretty-print -output-dir %t/Output
// RUN: %FileCheck %s --input-file %t/Output/Basic.symbols.json
public struct S {
public var x: Int
}

View File

@@ -0,0 +1,19 @@
// RUN: %empty-directory(%t)
// RUN: %empty-directory(%t/Output)
// RUN: %target-build-swift %s -module-name Basic -emit-module -emit-module-path %t/
// Verify that -target can be inferred
// RUN: %empty-directory(%t/Output)
// RUN: %swift-symbolgraph-extract -module-name Basic -I %t -pretty-print -output-dir %t/Output
// RUN: %FileCheck %s --input-file %t/Output/Basic.symbols.json
// This test can only work for test configurations that aren't cross-compiling.
// REQUIRES: OS=macosx || OS=linux-gnu || OS=windows-msvc
public struct S {
public var x: Int
}
// CHECK: "kind": "memberOf"
// CHECK-NEXT: "source": "s:5Basic1SV1xSivp"
// CHECK-NEXT: "target": "s:5Basic1SV"