| 1 |
//===- AssignTest.cpp -- assignment runtime builder unit tests ------------===// |
| 2 |
// |
| 3 |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
// See https://llvm.org/LICENSE.txt for license information. |
| 5 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
#include "flang/Optimizer/Builder/Runtime/Assign.h" |
| 10 |
#include "RuntimeCallTestBase.h" |
| 11 |
#include "gtest/gtest.h" |
| 12 |
|
| 13 |
TEST_F(RuntimeCallTest, genDerivedTypeAssign) { |
| 14 |
auto loc = firBuilder->getUnknownLoc(); |
| 15 |
mlir::Type seqTy = |
| 16 |
fir::SequenceType::get(fir::SequenceType::Shape(1, 10), i32Ty); |
| 17 |
mlir::Value source = firBuilder->create<fir::UndefOp>(loc, seqTy); |
| 18 |
mlir::Value dest = firBuilder->create<fir::UndefOp>(loc, seqTy); |
| 19 |
fir::runtime::genAssign(*firBuilder, loc, dest, source); |
| 20 |
checkCallOpFromResultBox(dest, "_FortranAAssign", 2); |
| 21 |
} |