cgen: fix test

pull/4105/head
Joe Conigliaro 2020-03-23 02:30:45 +11:00
parent 076bc2b773
commit 99de98ffc7
1 changed files with 3 additions and 3 deletions

View File

@ -48,11 +48,11 @@ void println(string s) {
}
void handle_expr(Expr e) {
if (e.typ == 25 /* IfExpr */) {
if (e.typ == 26 /* IfExpr */) {
IfExpr* it = (IfExpr*)e.obj; // ST it
println(tos3("if"));
}
else if (e.typ == 26 /* IntegerLiteral */) {
else if (e.typ == 27 /* IntegerLiteral */) {
IntegerLiteral* it = (IntegerLiteral*)e.obj; // ST it
println(tos3("integer"));
}
@ -73,7 +73,7 @@ int main(int argc, char** argv) {
Option_int n = get_opt();
int a = /*opt*/(*(int*)n.data) + 3;
handle_expr(/* sum type cast */ (Expr) {.obj = memdup(&(IfExpr[]) {(IfExpr){
0}}, sizeof(IfExpr)), .typ = 25 /* IfExpr */});
0}}, sizeof(IfExpr)), .typ = 26 /* IfExpr */});
return 0;
}