Skip to content

Commit 10fd9ff

Browse files
Merge pull request #69377 from kateinoigakukun/pr-dd9547449f4df3e3b993f91b36f4840d529438dc
[test] Adjust extern_c_abitypes.swift to accept armv7k struct layout
2 parents d47b00a + 840bb7f commit 10fd9ff

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/IRGen/extern_c_abitypes.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %empty-directory(%t)
22
// RUN: split-file %s %t
3-
// RUN: %target-swift-frontend -emit-ir -enable-experimental-feature Extern %t/extern_c.swift -I%t | %FileCheck %s
3+
// RUN: %target-swift-frontend -emit-ir -enable-experimental-feature Extern %t/extern_c.swift -I%t | %FileCheck %s --check-prefixes CHECK,CHECK-%target-cpu
44

55
//--- c_abi_types.h
66
#include <stdbool.h>
@@ -99,8 +99,14 @@ func test() {
9999

100100
// assume %struct.c_struct and %TSo8c_structV have compatible layout
101101
//
102-
// CHECK: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%struct.c_struct) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}})
103-
// CHECK: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}})
102+
// CHECK-x86_64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%struct.c_struct) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}})
103+
// CHECK-x86_64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}})
104+
// CHECK-arm64: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%struct.c_struct) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}})
105+
// CHECK-arm64: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}})
106+
// CHECK-wasm32: call void @c_roundtrip_c_struct(ptr noalias nocapture sret(%struct.c_struct) {{.*}}, ptr{{( byval\(%struct.c_struct\))?}}[[ALIGN:(align [0-9]+)?]] {{.*}})
107+
// CHECK-wasm32: call void @swift_roundtrip_c_struct(ptr noalias nocapture sret(%TSo8c_structV) {{.*}}, ptr{{( byval\(%TSo8c_structV\))?}}[[ALIGN]] {{.*}})
108+
// CHECK-armv7k: call [3 x i32] @c_roundtrip_c_struct([3 x i32] {{.*}})
109+
// CHECK-armv7k: call [3 x i32] @swift_roundtrip_c_struct([3 x i32] {{.*}})
104110
var c_struct_val = c_struct(foo: 496, bar: 28, baz: 8)
105111
_ = c_roundtrip_c_struct(c_struct_val)
106112
_ = swift_roundtrip_c_struct(c_struct_val)

0 commit comments

Comments
 (0)