diff --git a/project/src/transpiler/transpile_helper.cpp b/project/src/transpiler/transpile_helper.cpp index 1f03bb20..8e1634c0 100644 --- a/project/src/transpiler/transpile_helper.cpp +++ b/project/src/transpiler/transpile_helper.cpp @@ -462,6 +462,11 @@ EOObject GetStmtEOObject(const Stmt *stmt) { return {"\"" + value + "\"", EOObjectType::EO_LITERAL}; } + if (stmt_class == Stmt::ImplicitValueInitExprClass) { +// const auto *op = dyn_cast(stmt); +// todo: do i need type? + return {"0", EOObjectType::EO_LITERAL}; + } llvm::errs() << "Warning: Unknown statement " << stmt->getStmtClassName() << "\n"; diff --git a/project/tests/main/initList/test01.c b/project/tests/main/initList/test01.c new file mode 100644 index 00000000..01f7c361 --- /dev/null +++ b/project/tests/main/initList/test01.c @@ -0,0 +1,19 @@ +struct S1 { + int a; + int b; + int c; + int d; +}; + + +struct S1 v = {1, .c=2, 3}; + +int a[5] = {1,2,[4]=5}; + +//#include +int main() +{ +// printf("%d %d %d %d\n", v.a, v.b, v.c, v.d); +// printf("%d %d %d %d %d\n", a[0], a[1], a[2], a[3], a[4]); + return 0; +}