MCPcopy Create free account
hub / github.com/GANGE666/xVMP / TEST

Function TEST

src/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp:28–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28TEST(BasicBlockUtils, SplitBlockPredecessors) {
29 LLVMContext C;
30
31 std::unique_ptr<Module> M = parseIR(
32 C,
33 "define i32 @basic_func(i1 %cond) {\n"
34 "entry:\n"
35 " br i1 %cond, label %bb0, label %bb1\n"
36 "bb0:\n"
37 " br label %bb1\n"
38 "bb1:\n"
39 " %phi = phi i32 [ 0, %entry ], [ 1, %bb0 ]"
40 " ret i32 %phi\n"
41 "}\n"
42 "\n"
43 );
44
45 auto *F = M->getFunction("basic_func");
46 DominatorTree DT(*F);
47
48 // Make sure the dominator tree is properly updated if calling this on the
49 // entry block.
50 SplitBlockPredecessors(&F->getEntryBlock(), {}, "split.entry", &DT);
51 EXPECT_TRUE(DT.verify());
52}

Callers

nothing calls this directly

Calls 4

parseIRFunction · 0.70
getFunctionMethod · 0.45
getEntryBlockMethod · 0.45
verifyMethod · 0.45

Tested by

no test coverage detected