From 9fc8a3ab063fb23832419f5c5881438b0c41970c Mon Sep 17 00:00:00 2001 From: Riabtsev Yaroslav Date: Fri, 28 Oct 2022 04:13:49 +0200 Subject: [PATCH] skip --- project/scripts/data/skips/gcc.txt | 3 ++- project/scripts/data/skips/testcuite.txt | 4 +++- project/src/transpiler/transpile_helper.cpp | 25 +++++++++++---------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/project/scripts/data/skips/gcc.txt b/project/scripts/data/skips/gcc.txt index 35047397..afa8db61 100644 --- a/project/scripts/data/skips/gcc.txt +++ b/project/scripts/data/skips/gcc.txt @@ -51,4 +51,5 @@ limits-blockid, limits-externalid, limits-externdecl: too much handling time limits-caselabels: exceeded the number of cases allowed by the c standard 921215-1: Function inside function does not comply with the ะก standard 20020604-1: Float semantics are not IEEEdouble -990928-1.c: run with ASAN_OPTIONS=detect_leaks=0 \ No newline at end of file +990928-1: run with ASAN_OPTIONS=detect_leaks=0 +limits-pointer, pr46534: time limit \ No newline at end of file diff --git a/project/scripts/data/skips/testcuite.txt b/project/scripts/data/skips/testcuite.txt index 983e800c..7a7e1bf4 100644 --- a/project/scripts/data/skips/testcuite.txt +++ b/project/scripts/data/skips/testcuite.txt @@ -18,4 +18,6 @@ 00205: java code too large 00025, 00180, 00179: using str functions 00214: using __builtin_expect -00143: unsupported Tom Duff's switch \ No newline at end of file +00143: unsupported Tom Duff's switch + +00026: idk \ No newline at end of file diff --git a/project/src/transpiler/transpile_helper.cpp b/project/src/transpiler/transpile_helper.cpp index eb319ea1..093113b8 100644 --- a/project/src/transpiler/transpile_helper.cpp +++ b/project/src/transpiler/transpile_helper.cpp @@ -608,10 +608,10 @@ EOObject GetInitListEOObject(const clang::InitListExpr *list) { } eoList.nested.push_back(constData); } - if (elementType.name != "undefinedtype" && !elementType.name.empty() && - elementType.typeStyle != ComplexType::RECORD && - !(elementType.typeStyle == ComplexType::ARRAY && - elementType.name != "string")) { + if ((elementType.name != "undefinedtype" && !elementType.name.empty() && + elementType.typeStyle != ComplexType::RECORD && + elementType.typeStyle != ComplexType::ARRAY) || + elementType.name == "string") { res.name += "-as-" + elementType.name; } else /*if (elementType.name.empty())*/ { // list->dump(); @@ -1176,13 +1176,14 @@ EOObject GetIntegerLiteralEOObject(const IntegerLiteral *p_literal) { return EOObject{str_val, EOObjectType::EO_LITERAL}; } const uint64_t val = an_int.getZExtValue(); - if (val >= (1UL << 63)) { + if (val > 9223372036854775808ULL) { // 2^63 EOObject plus{"plus"}; EOObject times{"times"}; - times.nested.emplace_back(std::to_string(val / (1UL << 32))); - times.nested.emplace_back(std::to_string((1UL << 32))); + const uint64_t base = 4294967296L; // 2^32 + times.nested.emplace_back(std::to_string(val / base)); + times.nested.emplace_back(std::to_string(base)); plus.nested.push_back(times); - plus.nested.emplace_back(std::to_string(val % (1UL << 32))); + plus.nested.emplace_back(std::to_string(val % base)); } else { const std::string str_val{std::to_string(val)}; return EOObject{str_val, EOObjectType::EO_LITERAL}; @@ -1566,10 +1567,10 @@ EOObject GetAssignmentOperatorEOObject(const BinaryOperator *p_operator) { } } } - if (typeInfo.typeStyle != ComplexType::RECORD && - !(typeInfo.typeStyle == ComplexType::ARRAY && - typeInfo.name != "string") && - typeInfo.name != "undefinedtype") { + if ((typeInfo.typeStyle != ComplexType::RECORD && + typeInfo.typeStyle != ComplexType::ARRAY && + typeInfo.name != "undefinedtype") || + typeInfo.name == "string") { binary_op.name += "-as-" + typeInfo.name; } binary_op.nested.emplace_back(GetStmtEOObject(left));