File tree 2 files changed +50
-1
lines changed
2 files changed +50
-1
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ makeDDG(const std::string &DDG,
20
20
FAIL () << " Unsupported operation convertSUnits()" ;
21
21
}
22
22
void convertRegFiles () override {
23
- FAIL () << " Unsupported operation convertRegFile ()" ;
23
+ FAIL () << " Unsupported operation convertRegFiles ()" ;
24
24
}
25
25
};
26
26
Original file line number Diff line number Diff line change 1
1
#include " ddg.h"
2
2
3
+ #include " gtest/gtest-spi.h"
3
4
#include " gtest/gtest.h"
4
5
5
6
using namespace llvm ::opt_sched;
@@ -111,4 +112,52 @@ dep 5 0 "other" 0
111
112
112
113
EXPECT_EQ (7 , DDG->GetNodeCnt ());
113
114
}
115
+
116
+ TEST (SimpleDDG, VirtualFunctionsFailWell) {
117
+ static std::shared_ptr<DataDepGraph> DDG = makeDDG (R"(
118
+ dag 3 "Simple"
119
+ {
120
+ dag_id fake:3
121
+ dag_weight 1.000000
122
+ compiler LLVM
123
+ dag_lb -1
124
+ dag_ub -1
125
+ nodes
126
+ node 0 "Inst"
127
+ sched_order 0
128
+ issue_cycle 0
129
+ node 1 "artificial" "__optsched_entry"
130
+ node 2 "artificial"
131
+ dependencies
132
+ dep 0 1 "other" 0
133
+ dep 1 2 "other" 0
134
+ }
135
+ )" );
136
+
137
+ EXPECT_FATAL_FAILURE (DDG->convertRegFiles (),
138
+ " Unsupported operation convertRegFiles" );
139
+ EXPECT_FATAL_FAILURE (DDG->convertSUnits (true , true ),
140
+ " Unsupported operation convertSUnits" );
141
+ }
142
+
143
+ TEST (SimpleDDG, MakeInvalidDDGFailsWell) {
144
+ EXPECT_NONFATAL_FAILURE (makeDDG (R"(
145
+ dag 3 "Simple"
146
+ {
147
+ dag_id fake:3
148
+ dag_weight 1.000000
149
+ compiler LLVM
150
+ dag_lb -1
151
+ dag_ub -1
152
+ nodes
153
+ node 0 "Inst"
154
+ sched_order 0
155
+ issue_cycle 0
156
+ node 1 "artificial" "__optsched_entry"
157
+ node 2 "artificial"
158
+ dependencies
159
+ }
160
+ )" ),
161
+ " parse DDG" );
162
+ }
114
163
} // namespace
You can’t perform that action at this time.
0 commit comments