@@ -67,44 +67,6 @@ TEST(CFG, IsLinear) {
67
67
expectLinear (true , " void foo() { foo(); }" ); // Recursion is not our problem.
68
68
}
69
69
70
- TEST (CFG, ConditionExpr) {
71
- const char *Code = R"( void f(bool A, bool B, bool C) {
72
- if (A && B && C)
73
- int x;
74
- })" ;
75
- BuildResult Result = BuildCFG (Code);
76
- EXPECT_EQ (BuildResult::BuiltCFG, Result.getStatus ());
77
-
78
- // [B5 (ENTRY)] -> [B4] -> [B3] -> [B2] -> [B1] -> [B0 (EXIT)]
79
- // \ \ \ /
80
- // ------------------------------->
81
-
82
- CFG *cfg = Result.getCFG ();
83
-
84
- auto GetBlock = [cfg] (unsigned Index) -> CFGBlock * {
85
- assert (Index < cfg->size ());
86
- return *(cfg->begin () + Index);
87
- };
88
-
89
- EXPECT_EQ (GetBlock (1 )->getLastCondition (), nullptr );
90
- // Unfortunately, we can't check whether the correct Expr was returned by
91
- // getLastCondition, because the lifetime of the AST ends by the time we
92
- // retrieve the CFG.
93
-
94
- // ===--------------------------------------------------------------------===//
95
-
96
- Code = R"( void foo(int x, int y) {
97
- (void)(x + y);
98
- })" ;
99
- Result = BuildCFG (Code);
100
- EXPECT_EQ (BuildResult::BuiltCFG, Result.getStatus ());
101
-
102
- // [B2 (ENTRY)] -> [B1] -> [B0 (EXIT)]
103
-
104
- cfg = Result.getCFG ();
105
- EXPECT_EQ (GetBlock (1 )->getLastCondition (), nullptr );
106
- }
107
-
108
70
} // namespace
109
71
} // namespace analysis
110
72
} // namespace clang
0 commit comments