llvm-project
29 строк · 1.2 Кб
1// RUN: tco --target=aarch64-unknown-linux-gnu %s | FileCheck %s --check-prefix=AARCH64
2
3// AARCH64-LABEL: define { fp128, fp128 } @gen16()
4func.func @gen16() -> !fir.complex<16> {
5// AARCH64: %[[VAL1:.*]] = alloca { fp128, fp128 }, i64 1, align 16
6%1 = fir.undefined !fir.complex<16>
7%2 = arith.constant 1.0 : f128
8%3 = arith.constant -4.0 : f128
9%c0 = arith.constant 0 : i32
10// AARCH64: store { fp128, fp128 } { fp128 0xL0000000000000000C001000000000000, fp128 0xL00000000000000003FFF000000000000 }, ptr %[[VAL1]], align 16
11%4 = fir.insert_value %1, %3, [0 : index] : (!fir.complex<16>, f128) -> !fir.complex<16>
12%c1 = arith.constant 1 : i32
13%5 = fir.insert_value %4, %2, [1 : index] : (!fir.complex<16>, f128) -> !fir.complex<16>
14// AARCH64: %[[VAL2:.*]] = load { fp128, fp128 }, ptr %[[VAL1]], align 16
15// AARCH64: ret { fp128, fp128 } %[[VAL2]]
16return %5 : !fir.complex<16>
17}
18
19// AARCH64: declare void @sink16([2 x fp128])
20func.func private @sink16(!fir.complex<16>) -> ()
21
22// AARCH64-LABEL: define void @call16()
23func.func @call16() {
24// AARCH64: = call { fp128, fp128 } @gen16()
25%1 = fir.call @gen16() : () -> !fir.complex<16>
26// AARCH64: call void @sink16([2 x fp128] %
27fir.call @sink16(%1) : (!fir.complex<16>) -> ()
28return
29}
30