Skip to content

Commit b5abea3

Browse files
authored
[test] Fix load-invalid-arch.swift to use the "major" architecture (#17342)
armv7, armv7s, and armv7k all get encoded as "arm" in today's scheme for swiftmodules, so we can't just use the CPU part of the triple as the expected swiftmodule architecture in the diagnostic.
1 parent 4660af6 commit b5abea3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Serialization/load-invalid-arch.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
// RUN: touch %t/new_module.swiftmodule/ppc65.swiftmodule
66
// RUN: touch %t/new_module.swiftmodule/i387.swiftdoc
77
// RUN: touch %t/new_module.swiftmodule/ppc65.swiftdoc
8-
// RUN: not %target-swift-frontend %s -typecheck -I %t -show-diagnostics-after-fatal 2>&1 | %FileCheck %s -DTARGET_ARCHITECTURE=%target-cpu
8+
// RUN: not %target-swift-frontend %s -typecheck -I %t -show-diagnostics-after-fatal 2>&1 | %FileCheck %s -DTARGET_ARCHITECTURE=$(echo %target-swiftmodule-name | cut -d. -f1)
99

1010
// RUN: %empty-directory(%t)
1111
// RUN: mkdir -p %t/new_module.framework/Modules/new_module.swiftmodule/
1212
// RUN: touch %t/new_module.framework/Modules/new_module.swiftmodule/i387.swiftmodule
1313
// RUN: touch %t/new_module.framework/Modules/new_module.swiftmodule/ppc65.swiftmodule
14-
// RUN: not %target-swift-frontend %s -F %t -typecheck -show-diagnostics-after-fatal 2>&1 | %FileCheck %s -DTARGET_ARCHITECTURE=%target-cpu
14+
// RUN: not %target-swift-frontend %s -F %t -typecheck -show-diagnostics-after-fatal 2>&1 | %FileCheck %s -DTARGET_ARCHITECTURE=$(echo %target-swiftmodule-name | cut -d. -f1)
1515

1616
//CHECK: {{.*}} error: could not find module 'new_module' for architecture '[[TARGET_ARCHITECTURE]]'; found: {{ppc65, i387|i387, ppc65}}
1717
//CHECK-NEXT: import new_module

0 commit comments

Comments
 (0)