1 // Test lowering FIR to LLVM IR for recursive types
3 // RUN: fir-opt --fir-to-llvm-ir="target=x86_64-unknown-linux-gnu" %s | FileCheck %s
4 // RUN: fir-opt --fir-to-llvm-ir="target=aarch64-unknown-linux-gnu" %s | FileCheck %s
5 // RUN: fir-opt --fir-to-llvm-ir="target=i386-unknown-linux-gnu" %s | FileCheck %s
6 // RUN: fir-opt --fir-to-llvm-ir="target=powerpc64le-unknown-linux-gn" %s | FileCheck %s
8 !t1 = !fir.type<t1 {a1:!fir.ptr<!fir.type<t1>>}>
9 !t2 = !fir.type<t2 {b1:f32,b2:!fir.ptr<!fir.type<t2>>,b3:i32,b4:!fir.ptr<!fir.type<t2>>}>
10 !t3 = !fir.type<t3 {c1:!fir.ptr<!fir.type<t4>>}>
11 !t4 = !fir.type<t4 {d1:!fir.ptr<!fir.type<t3>>}>
13 // CHECK-LABEL: llvm.func @recursiveTypes
14 // CHECK-SAME: %{{.*}}: !llvm.struct<"t1", (ptr)>
15 // CHECK-SAME: %{{.*}}: !llvm.struct<"t2", (f32, ptr, i32, ptr)>
16 // CHECK-SAME: %{{.*}}: !llvm.struct<"t3", (ptr)>, %{{.*}}: !llvm.struct<"t4", (ptr)>)
17 func.func @recursiveTypes(%a : !t1, %b : !t2, %c : !t3, %d : !t4) {