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