|
1 | 1 | // RUN: %empty-directory(%t)
|
2 | 2 | // 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 |
4 | 4 |
|
5 | 5 | //--- c_abi_types.h
|
6 | 6 | #include <stdbool.h>
|
@@ -99,8 +99,14 @@ func test() {
|
99 | 99 |
|
100 | 100 | // assume %struct.c_struct and %TSo8c_structV have compatible layout
|
101 | 101 | //
|
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] {{.*}}) |
104 | 110 | var c_struct_val = c_struct(foo: 496, bar: 28, baz: 8)
|
105 | 111 | _ = c_roundtrip_c_struct(c_struct_val)
|
106 | 112 | _ = swift_roundtrip_c_struct(c_struct_val)
|
|
0 commit comments