Jlm
Functions
LlvmModuleConversionTests.cpp File Reference
#include <gtest/gtest.h>
#include <jlm/llvm/frontend/LlvmModuleConversion.hpp>
#include <jlm/llvm/ir/CallingConvention.hpp>
#include <jlm/llvm/ir/cfg.hpp>
#include <jlm/llvm/ir/ipgraph-module.hpp>
#include <jlm/llvm/ir/ipgraph.hpp>
#include <jlm/llvm/ir/operators/AggregateOperations.hpp>
#include <jlm/llvm/ir/operators/call.hpp>
#include <jlm/llvm/ir/operators/operators.hpp>
#include <jlm/llvm/ir/operators/StdLibIntrinsicOperations.hpp>
#include <jlm/llvm/ir/print.hpp>
#include <jlm/rvsdg/bitstring/type.hpp>
#include <llvm/IR/BasicBlock.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/IR/Module.h>
Include dependency graph for LlvmModuleConversionTests.cpp:

Go to the source code of this file.

Functions

 TEST (LlvmModuleConversionTests, SwitchConversion)
 
 TEST (LlvmModuleConversionTests, FreezeConversion)
 
 TEST (LlvmModuleConversionTests, InsertValueConversion)
 
 TEST (LlvmModuleConversionTests, CallingConvConversion)
 
 TEST (LlvmModuleConversionTests, MemCpyConversion)
 
 TEST (LlvmModuleConversionTests, MemSetConversion)
 

Function Documentation

◆ TEST() [1/6]

TEST ( LlvmModuleConversionTests  ,
CallingConvConversion   
)

Tests that function declarations, function definitions and function calls in LLVM are converted into corresponding InterProceduralGraphModule functions and call operations with the same calling convention.

The LLVM looks like:

declare i64 fastcc @imported(i64);

define i64 coldcc @callee(i64 %1) {
    ret i64 %1
}

define i64 tailcc @caller(i64 %1) {
    %2 = call fastcc i64 @imported(i64 %1)
    %3 = call coldcc @callee(i64 %2)
    ret i64 %3
}

After conversion, the calling convention of the functions and calls are checked.

Definition at line 225 of file LlvmModuleConversionTests.cpp.

◆ TEST() [2/6]

TEST ( LlvmModuleConversionTests  ,
FreezeConversion   
)

Tests that freeze instructions in LLVM are converted into FreezeOperations in RVSDG, with the correct operand and type.

Definition at line 95 of file LlvmModuleConversionTests.cpp.

◆ TEST() [3/6]

TEST ( LlvmModuleConversionTests  ,
InsertValueConversion   
)

Tests that LLVM's insertvalue instructions are converted to correct RVSDG InsertValueOperations.

Definition at line 159 of file LlvmModuleConversionTests.cpp.

◆ TEST() [4/6]

TEST ( LlvmModuleConversionTests  ,
MemCpyConversion   
)

Definition at line 356 of file LlvmModuleConversionTests.cpp.

◆ TEST() [5/6]

TEST ( LlvmModuleConversionTests  ,
MemSetConversion   
)

Definition at line 430 of file LlvmModuleConversionTests.cpp.

◆ TEST() [6/6]

TEST ( LlvmModuleConversionTests  ,
SwitchConversion   
)

Definition at line 24 of file LlvmModuleConversionTests.cpp.