Skip to content

Commit 507ce25

Browse files
committed
LLVMCodeAnalyzer: Move common test cases to mixed tests
1 parent 31593f3 commit 507ce25

File tree

3 files changed

+29
-19
lines changed

3 files changed

+29
-19
lines changed

test/llvm/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ add_executable(
2323
llvmcodebuilder_test.cpp
2424
llvminstructionlist_test.cpp
2525
code_analyzer/variable_type_analysis.cpp
26+
code_analyzer/mixed_type_analysis.cpp
2627
operators/equal_comparison_test.cpp
2728
operators/greater_than_test.cpp
2829
operators/less_than_test.cpp
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <scratchcpp/variable.h>
2+
#include <scratchcpp/list.h>
3+
#include <engine/internal/llvm/llvmcodeanalyzer.h>
4+
#include <engine/internal/llvm/llvminstruction.h>
5+
#include <engine/internal/llvm/llvminstructionlist.h>
6+
#include <engine/internal/llvm/llvmconstantregister.h>
7+
#include <gtest/gtest.h>
8+
9+
using namespace libscratchcpp;
10+
11+
TEST(LLVMCodeAnalyzer_MixedTypeAnalysis, EmptyScript)
12+
{
13+
LLVMCodeAnalyzer analyzer;
14+
LLVMInstructionList list;
15+
16+
analyzer.analyzeScript(list);
17+
}
18+
19+
TEST(LLVMCodeAnalyzer_MixedTypeAnalysis, NoOperations)
20+
{
21+
LLVMCodeAnalyzer analyzer;
22+
LLVMInstructionList list;
23+
24+
auto funcCall = std::make_shared<LLVMInstruction>(LLVMInstruction::Type::FunctionCall, false);
25+
list.addInstruction(funcCall);
26+
27+
analyzer.analyzeScript(list);
28+
}

test/llvm/code_analyzer/variable_type_analysis.cpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,6 @@
77

88
using namespace libscratchcpp;
99

10-
TEST(LLVMCodeAnalyzer_VariableTypeAnalysis, EmptyScript)
11-
{
12-
LLVMCodeAnalyzer analyzer;
13-
LLVMInstructionList list;
14-
15-
analyzer.analyzeScript(list);
16-
}
17-
18-
TEST(LLVMCodeAnalyzer_VariableTypeAnalysis, NoVariableOperations)
19-
{
20-
LLVMCodeAnalyzer analyzer;
21-
LLVMInstructionList list;
22-
23-
auto funcCall = std::make_shared<LLVMInstruction>(LLVMInstruction::Type::FunctionCall, false);
24-
list.addInstruction(funcCall);
25-
26-
analyzer.analyzeScript(list);
27-
}
28-
2910
TEST(LLVMCodeAnalyzer_VariableTypeAnalysis, FirstVariableWrite)
3011
{
3112
LLVMCodeAnalyzer analyzer;

0 commit comments

Comments
 (0)