cgen: fix test
parent
076bc2b773
commit
99de98ffc7
|
@ -48,11 +48,11 @@ void println(string s) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void handle_expr(Expr e) {
|
void handle_expr(Expr e) {
|
||||||
if (e.typ == 25 /* IfExpr */) {
|
if (e.typ == 26 /* IfExpr */) {
|
||||||
IfExpr* it = (IfExpr*)e.obj; // ST it
|
IfExpr* it = (IfExpr*)e.obj; // ST it
|
||||||
println(tos3("if"));
|
println(tos3("if"));
|
||||||
}
|
}
|
||||||
else if (e.typ == 26 /* IntegerLiteral */) {
|
else if (e.typ == 27 /* IntegerLiteral */) {
|
||||||
IntegerLiteral* it = (IntegerLiteral*)e.obj; // ST it
|
IntegerLiteral* it = (IntegerLiteral*)e.obj; // ST it
|
||||||
println(tos3("integer"));
|
println(tos3("integer"));
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ int main(int argc, char** argv) {
|
||||||
Option_int n = get_opt();
|
Option_int n = get_opt();
|
||||||
int a = /*opt*/(*(int*)n.data) + 3;
|
int a = /*opt*/(*(int*)n.data) + 3;
|
||||||
handle_expr(/* sum type cast */ (Expr) {.obj = memdup(&(IfExpr[]) {(IfExpr){
|
handle_expr(/* sum type cast */ (Expr) {.obj = memdup(&(IfExpr[]) {(IfExpr){
|
||||||
0}}, sizeof(IfExpr)), .typ = 25 /* IfExpr */});
|
0}}, sizeof(IfExpr)), .typ = 26 /* IfExpr */});
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue