|
| 1 | +// RUN: cir-opt %s | FileCheck %s |
| 2 | + |
| 3 | +module { |
| 4 | + |
| 5 | +cir.global external @a : !cir.array<!cir.int<s, 32> x 10> |
| 6 | +// CHECK: cir.global external @a : !cir.array<!cir.int<s, 32> x 10> |
| 7 | + |
| 8 | +cir.global external @aa : !cir.array<!cir.array<!cir.int<s, 32> x 10> x 10> |
| 9 | +// CHECK: cir.global external @aa : !cir.array<!cir.array<!cir.int<s, 32> x 10> x 10> |
| 10 | + |
| 11 | +cir.global external @b : !cir.array<!cir.int<s, 32> x 10> |
| 12 | +// CHECK: cir.global external @b : !cir.array<!cir.int<s, 32> x 10> |
| 13 | + |
| 14 | +cir.global external @bb : !cir.array<!cir.array<!cir.int<s, 32> x 10> x 10> |
| 15 | +// CHECK: cir.global external @bb : !cir.array<!cir.array<!cir.int<s, 32> x 10> x 10> |
| 16 | + |
| 17 | +cir.func @f() { |
| 18 | + %0 = cir.alloca !cir.array<!cir.int<s, 32> x 10>, !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>, ["l"] {alignment = 4 : i64} |
| 19 | + cir.return |
| 20 | +} |
| 21 | + |
| 22 | +// CHECK: cir.func @f() { |
| 23 | +// CHECK: %0 = cir.alloca !cir.array<!cir.int<s, 32> x 10>, !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>, ["l"] {alignment = 4 : i64} |
| 24 | +// CHECK: cir.return |
| 25 | +// CHECK: } |
| 26 | + |
| 27 | +cir.func @f2(%arg0: !cir.ptr<!cir.int<s, 32>>) { |
| 28 | + %0 = cir.alloca !cir.ptr<!cir.int<s, 32>>, !cir.ptr<!cir.ptr<!cir.int<s, 32>>>, ["p", init] {alignment = 8 : i64} |
| 29 | + cir.store %arg0, %0 : !cir.ptr<!cir.int<s, 32>>, !cir.ptr<!cir.ptr<!cir.int<s, 32>>> |
| 30 | + cir.return |
| 31 | +} |
| 32 | + |
| 33 | +// CHECK: cir.func @f2(%arg0: !cir.ptr<!cir.int<s, 32>>) { |
| 34 | +// CHECK: %0 = cir.alloca !cir.ptr<!cir.int<s, 32>>, !cir.ptr<!cir.ptr<!cir.int<s, 32>>>, ["p", init] {alignment = 8 : i64} |
| 35 | +// CHECK: cir.store %arg0, %0 : !cir.ptr<!cir.int<s, 32>>, !cir.ptr<!cir.ptr<!cir.int<s, 32>>> |
| 36 | +// CHECK: cir.return |
| 37 | +// CHECK: } |
| 38 | + |
| 39 | +cir.func @f3(%arg0: !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>) { |
| 40 | + %0 = cir.alloca !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>, !cir.ptr<!cir.ptr<!cir.array<!cir.int<s, 32> x 10>>>, ["pp", init] {alignment = 8 : i64} |
| 41 | + cir.store %arg0, %0 : !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>, !cir.ptr<!cir.ptr<!cir.array<!cir.int<s, 32> x 10>>> |
| 42 | + cir.return |
| 43 | +} |
| 44 | + |
| 45 | +// CHECK: cir.func @f3(%arg0: !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>) { |
| 46 | +// CHECK: %0 = cir.alloca !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>, !cir.ptr<!cir.ptr<!cir.array<!cir.int<s, 32> x 10>>>, ["pp", init] {alignment = 8 : i64} |
| 47 | +// CHECK: cir.store %arg0, %0 : !cir.ptr<!cir.array<!cir.int<s, 32> x 10>>, !cir.ptr<!cir.ptr<!cir.array<!cir.int<s, 32> x 10>>> |
| 48 | +// CHECK: cir.return |
| 49 | +// CHECK: } |
| 50 | + |
| 51 | +} |
0 commit comments