Skip to content

Commit b7f26b3

Browse files
committed
use C++17 for IR generation and adjust unit tests accordingly
1 parent e67be90 commit b7f26b3

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmake/phasar_macros.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function(generate_ll_file)
7979
set(test_code_file_target "${parent_dir}_${test_code_file_name}${ll_file_suffix}")
8080

8181
# define compilation flags
82-
set(GEN_CXX_FLAGS -std=c++14 -fno-discard-value-names -emit-llvm -S)
82+
set(GEN_CXX_FLAGS -std=c++17 -fno-discard-value-names -emit-llvm -S)
8383
set(GEN_C_FLAGS -fno-discard-value-names -emit-llvm -S)
8484
set(GEN_CMD_COMMENT "[LL]")
8585
if(GEN_LL_MEM2REG)

unittests/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEGeneralizedLCATest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ TEST_F(IDEGeneralizedLCATest, StringTestCpp) {
138138
const auto *LastMainInstruction =
139139
getLastInstructionOf(IRDB->getFunction("main"));
140140
GroundTruth.push_back({{EdgeValue("Hello, World")},
141-
2,
141+
3,
142142
std::stoi(getMetaDataID(LastMainInstruction))});
143143
compareResults(GroundTruth);
144144
}

unittests/PhasarLLVM/DataFlowSolver/IfdsIde/Problems/IDEInstInteractionAnalysisTest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,11 +643,11 @@ PHASAR_SKIP_TEST(TEST_F(IDEInstInteractionAnalysisTest, HandleRVOTest_01) {
643643
"main", 16, "retval", {"23", "35", "37"}));
644644
GroundTruth.emplace(
645645
std::tuple<std::string, size_t, std::string, BitVectorSet<std::string>>(
646-
"main", 16, "str", {"24", "29", "31", "33", "36"}));
646+
"main", 16, "str", {"70", "65", "72", "74", "77"}));
647647
GroundTruth.emplace(
648648
std::tuple<std::string, size_t, std::string, BitVectorSet<std::string>>(
649-
"main", 16, "ref.tmp", {"25", "5", "8", "31", "32", "30"}));
650-
doAnalysisAndCompareResults("rvo_01_cpp.ll", GroundTruth, false);
649+
"main", 16, "ref.tmp", {"66", "9", "6", "29", "72", "73", "71"}));
650+
doAnalysisAndCompareResults("rvo_01_cpp.ll", GroundTruth, true);
651651
})
652652

653653
TEST_F(IDEInstInteractionAnalysisTest, HandleStruct_01) {

unittests/PhasarLLVM/TypeHierarchy/LLVMTypeHierarchyTest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ PHASAR_SKIP_TEST(TEST(LTHTest, HandleSTLString) {
737737
ProjectIRDB IRDB({unittest::PathToLLTestFiles +
738738
"type_hierarchies/type_hierarchy_13_cpp.ll"});
739739
LLVMTypeHierarchy TH(IRDB);
740-
EXPECT_EQ(TH.getAllTypes().size(), 4U);
740+
EXPECT_EQ(TH.getAllTypes().size(), 7U);
741741
EXPECT_TRUE(TH.hasType(TH.getType("class.std::__cxx11::basic_string")));
742742
EXPECT_TRUE(TH.hasType(
743743
TH.getType("struct.std::__cxx11::basic_string<char>::_Alloc_hider")));

0 commit comments

Comments
 (0)