1*ce8022faSJosh Mottley //===- StopTest.cpp -- Stop runtime builder unit tests ---------===// 2*ce8022faSJosh Mottley // 3*ce8022faSJosh Mottley // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*ce8022faSJosh Mottley // See https://llvm.org/LICENSE.txt for license information. 5*ce8022faSJosh Mottley // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*ce8022faSJosh Mottley // 7*ce8022faSJosh Mottley //===----------------------------------------------------------------------===// 8*ce8022faSJosh Mottley 9*ce8022faSJosh Mottley #include "flang/Optimizer/Builder/Runtime/Stop.h" 10*ce8022faSJosh Mottley #include "RuntimeCallTestBase.h" 11*ce8022faSJosh Mottley #include "gtest/gtest.h" 12*ce8022faSJosh Mottley TEST_F(RuntimeCallTest,genExitTest)13*ce8022faSJosh MottleyTEST_F(RuntimeCallTest, genExitTest) { 14*ce8022faSJosh Mottley mlir::Location loc = firBuilder->getUnknownLoc(); 15*ce8022faSJosh Mottley mlir::Value status = firBuilder->createIntegerConstant(loc, i32Ty, 0); 16*ce8022faSJosh Mottley fir::runtime::genExit(*firBuilder, loc, status); 17*ce8022faSJosh Mottley mlir::Block *block = firBuilder->getBlock(); 18*ce8022faSJosh Mottley EXPECT_TRUE(block) << "Failed to retrieve the block!"; 19*ce8022faSJosh Mottley checkBlockForCallOp(block, "_FortranAExit", 1); 20*ce8022faSJosh Mottley } 21