From 41e267a44593c16185ee554e6267a8e38c961bf0 Mon Sep 17 00:00:00 2001 From: Marc Auberer Date: Sat, 3 Sep 2022 00:07:09 +0200 Subject: [PATCH] Add internal string objects (#198) * Allow long type as array index * Add test for string object * Extend time std * Extend string runtime std * Add opNotEquals operator --- .github/dependabot.yml | 2 +- .github/workflows/publish.yml | 4 +- .run/Spice_run.run.xml | 2 +- media/test-project/os-test.spice | 11 +- src-bootstrap/exception/SemanticError.spice | 2 +- src/analyzer/AnalyzerVisitor.cpp | 11 +- src/exception/SemanticError.cpp | 4 +- src/exception/SemanticError.h | 2 +- src/generator/OpRuleConversionsManager.cpp | 32 ++-- src/linker/LinkerInterface.h | 2 +- src/parser/AstBuilderVisitor.cpp | 31 ++- src/symbol/SymbolType.cpp | 4 +- std/runtime/string_rt.spice | 178 +++++++++++++++--- std/runtime/thread_rt.spice | 9 +- std/type/string.spice | 14 +- test/StdTest.cpp | 5 +- .../array-index-not-type-int/exception.out | 2 +- .../exception.out | 2 +- .../arbitrary/success-ackermann/ir-code-O3.ll | 4 +- .../arbitrary/success-ackermann/ir-code.ll | 4 +- .../arbitrary/success-faculty/ir-code-O3.ll | 4 +- .../arbitrary/success-faculty/ir-code.ll | 4 +- .../success-fibonacci-threaded/ir-code-O3.ll | 4 +- .../arbitrary/success-fibonacci/ir-code-O3.ll | 4 +- .../arbitrary/success-fibonacci/ir-code.ll | 4 +- .../success-hello-world/ir-code-O2.ll | 4 +- .../success-hello-world2/ir-code-O3.ll | 4 +- .../arbitrary/success-pidigits/ir-code-O3.ll | 4 +- .../arbitrary/success-pidigits/ir-code.ll | 4 +- .../success-arrays-dynamic-size/ir-code.ll | 4 +- .../ir-code.ll | 4 +- .../arrays/success-arrays/ir-code.ll | 4 +- .../arrays/success-arrays2/ir-code.ll | 4 +- .../arrays/success-arrays3/ir-code.ll | 4 +- .../arrays/success-arrays4/ir-code.ll | 4 +- .../success-string-char-access/ir-code.ll | 4 +- .../success-basic-assertion/ir-code.ll | 4 +- .../builtins/success-len/ir-code-O2.ll | 4 +- .../generator/builtins/success-len/ir-code.ll | 4 +- .../builtins/success-printf/ir-code-O2.ll | 4 +- .../builtins/success-printf/ir-code.ll | 4 +- .../builtins/success-sizeof/ir-code-O2.ll | 4 +- .../builtins/success-sizeof/ir-code.ll | 4 +- .../cli-args/success-cli-args/ir-code.ll | 4 +- .../ext-decl/success-ext-decl/ir-code-O1.ll | 4 +- .../ext-decl/success-ext-decl/ir-code.ll | 4 +- .../success-for-loop-break/ir-code-O2.ll | 4 +- .../success-for-loop-break/ir-code.ll | 4 +- .../success-for-loop-continue/ir-code-O2.ll | 4 +- .../success-for-loop-continue/ir-code.ll | 4 +- .../for-loops/success-for-loop/ir-code.ll | 4 +- .../ir-code.ll | 4 +- .../success-foreach-loop-break/ir-code-O2.ll | 4 +- .../success-foreach-loop-break/ir-code.ll | 4 +- .../ir-code-O2.ll | 4 +- .../success-foreach-loop-continue/ir-code.ll | 4 +- .../ir-code.ll | 4 +- .../success-foreach-loop-indexed/ir-code.ll | 4 +- .../success-foreach-loop-normal/ir-code.ll | 4 +- .../ir-code.ll | 4 +- .../success-default-arg-values/ir-code.ll | 4 +- .../functions/success-down-call/ir-code.ll | 4 +- .../success-explicit-inlining/ir-code-O2.ll | 4 +- .../success-explicit-inlining/ir-code.ll | 4 +- .../functions/success-overloading/ir-code.ll | 4 +- .../success-result-variable/ir-code.ll | 4 +- .../ir-code.ll | 4 +- .../success-generic-functions/ir-code.ll | 4 +- .../success-generic-functions2/ir-code.ll | 4 +- .../success-generic-structs/ir-code.ll | 4 +- .../if-stmts/success-if-else-stmt/ir-code.ll | 4 +- .../if-stmts/success-if-stmt/ir-code.ll | 4 +- .../imports/success-modules-std/ir-code.ll | 4 +- .../imports/success-modules/ir-code.ll | 4 +- .../success-method-down-up-call/ir-code.ll | 4 +- .../methods/success-methods/ir-code.ll | 4 +- .../operators/success-operators/ir-code.ll | 4 +- .../operators/success-operators2/ir-code.ll | 4 +- .../success-short-circuiting/ir-code.ll | 4 +- .../success-nested-pointers/ir-code.ll | 4 +- .../success-pointer-functions/ir-code.ll | 4 +- .../pointers/success-pointer/ir-code.ll | 4 +- .../success-early-return/ir-code.ll | 4 +- .../success-explicit-inlining/ir-code-O2.ll | 4 +- .../success-explicit-inlining/ir-code.ll | 4 +- .../structs/success-constructors/ir-code.ll | 4 +- .../success-external-nested-struct/ir-code.ll | 4 +- .../success-external-structs/ir-code.ll | 4 +- .../success-struct-field-access/ir-code.ll | 4 +- .../success-struct-in-place/ir-code.ll | 4 +- .../success-struct-self-ref/ir-code.ll | 4 +- .../structs/success-struct/ir-code.ll | 4 +- .../ir-code.ll | 4 +- .../ternary/success-ternary-stmt/ir-code.ll | 4 +- .../success-basic-threads/ir-code-O2.ll | 4 +- .../threads/success-basic-threads/ir-code.ll | 4 +- .../success-thread-joining/ir-code-O2.ll | 4 +- .../threads/success-thread-joining/ir-code.ll | 4 +- .../success-threads-captures1/ir-code-O2.ll | 4 +- .../success-threads-captures1/ir-code.ll | 4 +- .../success-threads-captures2/ir-code-O2.ll | 4 +- .../success-threads-captures2/ir-code.ll | 4 +- .../unsafe/success-pointer-cast/ir-code.ll | 4 +- .../success-decl-default-value/ir-code.ll | 4 +- .../success-external-global-var/ir-code.ll | 4 +- .../success-global-variables/ir-code.ll | 4 +- .../success-while-loop-break/ir-code-O2.ll | 4 +- .../success-while-loop-break/ir-code.ll | 4 +- .../success-while-loop-continue/ir-code-O2.ll | 4 +- .../success-while-loop-continue/ir-code.ll | 4 +- .../while-loops/success-while-loop/ir-code.ll | 4 +- .../data/pair-normal-usecase/ir-code-O2.ll | 4 +- .../data/queue-normal-usecase/ir-code-O2.ll | 4 +- .../data/stack-normal-usecase/ir-code-O2.ll | 4 +- .../data/triple-normal-usecase/ir-code-O2.ll | 4 +- .../data/vector-normal-usecase/ir-code-O2.ll | 4 +- .../io/mkdir-rmdir-direxists/ir-code-O2.ll | 4 +- .../runtime/string-basic-operations/cout.out | 27 +++ .../string-basic-operations/ir-code-O2.ll | 102 ++++++++++ .../string-basic-operations/source.spice | 32 ++++ .../std/runtime/string-char-ctor/cout.out | 8 + .../runtime/string-char-ctor/ir-code-O2.ll | 46 +++++ .../std/runtime/string-char-ctor/source.spice | 12 ++ 123 files changed, 669 insertions(+), 271 deletions(-) create mode 100644 test/test-files/std/runtime/string-basic-operations/cout.out create mode 100644 test/test-files/std/runtime/string-basic-operations/ir-code-O2.ll create mode 100644 test/test-files/std/runtime/string-basic-operations/source.spice create mode 100644 test/test-files/std/runtime/string-char-ctor/cout.out create mode 100644 test/test-files/std/runtime/string-char-ctor/ir-code-O2.ll create mode 100644 test/test-files/std/runtime/string-char-ctor/source.spice diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9b7ffb435..137ab29a7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,7 +14,7 @@ updates: assignees: - spicelang/compiler-team - # Github Actions + # GitHub Actions - package-ecosystem: github-actions directory: / schedule: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 775e88214..7b29cc990 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -184,7 +184,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Restore Go modules cache uses: actions/cache@v3 @@ -222,7 +222,7 @@ jobs: - name: Run GoReleaser uses: goreleaser/goreleaser-action@v3 with: - version: v1.10.3 + version: v1.11.2 args: release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.run/Spice_run.run.xml b/.run/Spice_run.run.xml index dfadeebbf..97eb8b784 100644 --- a/.run/Spice_run.run.xml +++ b/.run/Spice_run.run.xml @@ -1,5 +1,5 @@ - + diff --git a/media/test-project/os-test.spice b/media/test-project/os-test.spice index 34e41f8b9..cab098535 100644 --- a/media/test-project/os-test.spice +++ b/media/test-project/os-test.spice @@ -10,9 +10,18 @@ f main() { printf("Hello %s!", p1.getSecond()); }*/ -import "std/net/http" as http; +/*import "std/net/http" as http; f main() { http::HttpServer server = http::HttpServer(); server.serve("/test", "Hello World!"); +}*/ + +import "std/runtime/string_rt" as _rt_str; + +f main() { + _rt_str::String s1 = _rt_str::String('H'); + s1.append("ello"); + + printf("Equals: %d", s1.opEquals("Hell2")); } \ No newline at end of file diff --git a/src-bootstrap/exception/SemanticError.spice b/src-bootstrap/exception/SemanticError.spice index ca8e1cf00..2452863b0 100644 --- a/src-bootstrap/exception/SemanticError.spice +++ b/src-bootstrap/exception/SemanticError.spice @@ -41,7 +41,7 @@ public type ErrorType enum { NUMBER_OF_FIELDS_NOT_MATCHING, FIELD_TYPE_NOT_MATCHING, ARRAY_SIZE_INVALID, - ARRAY_INDEX_NO_INTEGER, + ARRAY_INDEX_NOT_INT_OR_LONG, ARRAY_ITEM_TYPE_NOT_MATCHING, EXPECTED_ARRAY_TYPE, SIZEOF_DYNAMIC_SIZED_ARRAY, diff --git a/src/analyzer/AnalyzerVisitor.cpp b/src/analyzer/AnalyzerVisitor.cpp index b56078074..f4ffd9729 100644 --- a/src/analyzer/AnalyzerVisitor.cpp +++ b/src/analyzer/AnalyzerVisitor.cpp @@ -901,7 +901,7 @@ std::any AnalyzerVisitor::visitForeachLoop(ForeachLoopNode *node) { // Check if index type is int if (!indexType.is(TY_INT)) - throw SemanticError(node->idxVarDecl()->codeLoc, ARRAY_INDEX_NO_INTEGER, + throw SemanticError(node->idxVarDecl()->codeLoc, ARRAY_INDEX_NOT_INT_OR_LONG, "Index in foreach loop must be of type int. You provided " + indexType.getName(false)); } else { // Declare the variable with the default index variable name @@ -1657,8 +1657,8 @@ std::any AnalyzerVisitor::visitPostfixUnaryExpr(PostfixUnaryExprNode *node) { AssignExprNode *indexExpr = node->assignExpr()[subscriptCounter++]; auto indexType = any_cast(visit(indexExpr)); - if (!indexType.is(TY_INT)) - throw SemanticError(node->codeLoc, ARRAY_INDEX_NO_INTEGER, "Array index must be of type int"); + if (!indexType.isOneOf({TY_INT, TY_LONG})) + throw SemanticError(node->codeLoc, ARRAY_INDEX_NOT_INT_OR_LONG, "Array index must be of type int or long"); if (!lhs.isOneOf({TY_ARRAY, TY_STRING, TY_PTR})) throw SemanticError(node->codeLoc, OPERATOR_WRONG_DATA_TYPE, "Can only apply subscript operator on array type, got " + lhs.getName(true)); @@ -2070,8 +2070,9 @@ std::any AnalyzerVisitor::visitArrayInitialization(ArrayInitializationNode *node if (actualItemType.is(TY_DYN)) { // Not enough info to perform type inference, because of empty array {} if (expectedType.is(TY_DYN)) throw SemanticError(node->codeLoc, UNEXPECTED_DYN_TYPE_SA, "Not enough information to perform type inference"); - if (expectedType.is(TY_DYN)) - throw SemanticError(node->codeLoc, ARRAY_ITEM_TYPE_NOT_MATCHING, "Cannot assign an array to a primitive data type"); + if (!expectedType.isArray()) + throw SemanticError(node->codeLoc, ARRAY_ITEM_TYPE_NOT_MATCHING, + "Cannot initialize array for type " + expectedType.getName() + ""); actualItemType = expectedType.getContainedTy(); } diff --git a/src/exception/SemanticError.cpp b/src/exception/SemanticError.cpp index 1f69421bf..dfe57fb92 100644 --- a/src/exception/SemanticError.cpp +++ b/src/exception/SemanticError.cpp @@ -108,8 +108,8 @@ std::string SemanticError::getMessagePrefix(SemanticErrorType type) { return "The type of a field value does not match the declaration"; case ARRAY_SIZE_INVALID: return "Array size invalid"; - case ARRAY_INDEX_NO_INTEGER: - return "Array index not of type int"; + case ARRAY_INDEX_NOT_INT_OR_LONG: + return "Array index not of type int or long"; case ARRAY_ITEM_TYPE_NOT_MATCHING: return "Array item type not matching"; case EXPECTED_ARRAY_TYPE: diff --git a/src/exception/SemanticError.h b/src/exception/SemanticError.h index 1d060f764..3d8133781 100644 --- a/src/exception/SemanticError.h +++ b/src/exception/SemanticError.h @@ -50,7 +50,7 @@ enum SemanticErrorType { NUMBER_OF_FIELDS_NOT_MATCHING, FIELD_TYPE_NOT_MATCHING, ARRAY_SIZE_INVALID, - ARRAY_INDEX_NO_INTEGER, + ARRAY_INDEX_NOT_INT_OR_LONG, ARRAY_ITEM_TYPE_NOT_MATCHING, EXPECTED_ARRAY_TYPE, SIZEOF_DYNAMIC_SIZED_ARRAY, diff --git a/src/generator/OpRuleConversionsManager.cpp b/src/generator/OpRuleConversionsManager.cpp index dea415997..302151033 100644 --- a/src/generator/OpRuleConversionsManager.cpp +++ b/src/generator/OpRuleConversionsManager.cpp @@ -43,7 +43,7 @@ llvm::Value *OpRuleConversionsManager::getPlusEqualInst(llvm::Value *lhs, llvm:: // ToDo(@marcauberer): Insert call to appendChar in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '+=' operator for lhs=string and rhs=char yet"); case COMB(TY_STRING, TY_STRING): - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to append in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '+=' operator for lhs=string and rhs=string yet"); case COMB(TY_PTR, TY_INT): // fallthrough case COMB(TY_PTR, TY_SHORT): // fallthrough @@ -466,7 +466,7 @@ llvm::Value *OpRuleConversionsManager::getEqualInst(llvm::Value *lhs, llvm::Valu case COMB(TY_CHAR, TY_CHAR): return builder->CreateICmpEQ(lhs, rhs); case COMB(TY_STRING, TY_STRING): - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opEquals in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '==' operator for lhs=string and rhs=string yet"); case COMB(TY_BOOL, TY_BOOL): return builder->CreateICmpEQ(lhs, rhs); @@ -571,7 +571,7 @@ llvm::Value *OpRuleConversionsManager::getNotEqualInst(llvm::Value *lhs, llvm::V case COMB(TY_CHAR, TY_CHAR): return builder->CreateICmpNE(lhs, rhs); case COMB(TY_STRING, TY_STRING): - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opNotEquals in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '!=' operator for lhs=string and rhs=string yet"); case COMB(TY_BOOL, TY_BOOL): return builder->CreateICmpNE(lhs, rhs); @@ -944,7 +944,7 @@ llvm::Value *OpRuleConversionsManager::getPlusInst(llvm::Value *lhs, llvm::Value case COMB(TY_CHAR, TY_CHAR): return builder->CreateAdd(lhs, rhs); case COMB(TY_STRING, TY_STRING): - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to append in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '+' operator for lhs=string and rhs=string yet"); case COMB(TY_PTR, TY_INT): // fallthrough case COMB(TY_PTR, TY_SHORT): // fallthrough @@ -1054,11 +1054,11 @@ llvm::Value *OpRuleConversionsManager::getMulInst(llvm::Value *lhs, llvm::Value return builder->CreateMul(lhsLong, rhs); } case COMB(TY_INT, TY_CHAR): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=int and rhs=char yet"); } case COMB(TY_INT, TY_STRING): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=int and rhs=string yet"); } case COMB(TY_SHORT, TY_DOUBLE): { @@ -1076,11 +1076,11 @@ llvm::Value *OpRuleConversionsManager::getMulInst(llvm::Value *lhs, llvm::Value return builder->CreateMul(lhsLong, rhs); } case COMB(TY_SHORT, TY_CHAR): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=short and rhs=char yet"); } case COMB(TY_SHORT, TY_STRING): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=short and rhs=string yet"); } case COMB(TY_LONG, TY_DOUBLE): { @@ -1095,37 +1095,37 @@ llvm::Value *OpRuleConversionsManager::getMulInst(llvm::Value *lhs, llvm::Value case COMB(TY_LONG, TY_LONG): return builder->CreateMul(lhs, rhs); case COMB(TY_LONG, TY_CHAR): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=long and rhs=char yet"); } case COMB(TY_LONG, TY_STRING): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=long and rhs=string yet"); } case COMB(TY_BYTE, TY_BYTE): return builder->CreateMul(lhs, rhs); case COMB(TY_CHAR, TY_INT): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=char and rhs=int yet"); } case COMB(TY_CHAR, TY_SHORT): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=char and rhs=short yet"); } case COMB(TY_CHAR, TY_LONG): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=char and rhs=long yet"); } case COMB(TY_STRING, TY_INT): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=string and rhs=int yet"); } case COMB(TY_STRING, TY_SHORT): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=string and rhs=short yet"); } case COMB(TY_STRING, TY_LONG): { - // ToDo(@marcauberer): Insert call to concatStrings in the runtime lib + // ToDo(@marcauberer): Insert call to opMul in the runtime lib throw IRError(codeLoc, COMING_SOON_IR, "The compiler does not support the '*' operator for lhs=string and rhs=long yet"); } } diff --git a/src/linker/LinkerInterface.h b/src/linker/LinkerInterface.h index 9cdd87b27..84fad93b0 100644 --- a/src/linker/LinkerInterface.h +++ b/src/linker/LinkerInterface.h @@ -27,6 +27,6 @@ class LinkerInterface { const ThreadFactory &threadFactory; const CliOptions &cliOptions; std::vector objectFilePaths; - std::vector linkerFlags = {"-no-pie"}; + std::vector linkerFlags = {"-no-pie", "-flto"}; std::string outputPath; }; \ No newline at end of file diff --git a/src/parser/AstBuilderVisitor.cpp b/src/parser/AstBuilderVisitor.cpp index e3f71cff0..64e69f512 100644 --- a/src/parser/AstBuilderVisitor.cpp +++ b/src/parser/AstBuilderVisitor.cpp @@ -1577,11 +1577,38 @@ int64_t AstBuilderVisitor::parseLong(antlr4::tree::TerminalNode *terminal) { int8_t AstBuilderVisitor::parseChar(antlr4::tree::TerminalNode *terminal) { std::string input = terminal->toString(); - if (input.length() != 3) { + if (input.length() == 3) { // Normal char literals + return input[1]; + } else if (input.length() == 4 && input[1] == '\\') { // Char literals with escape sequence + switch (input[2]) { + case '\'': + return '\''; + case '"': + return '\"'; + case '\\': + return '\\'; + case 'n': + return '\n'; + case 'r': + return '\r'; + case 't': + return '\t'; + case 'b': + return '\b'; + case 'f': + return '\f'; + case 'v': + return '\v'; + case '0': + return '\0'; + default: + CodeLoc codeLoc = CodeLoc(terminal->getSymbol(), fileName); + throw LexerParserError(codeLoc, PARSING_FAILED, "Invalid escape sequence " + input); + } + } else { CodeLoc codeLoc = CodeLoc(terminal->getSymbol(), fileName); throw LexerParserError(codeLoc, PARSING_FAILED, "Invalid char literal " + input); } - return input[1]; } std::string AstBuilderVisitor::parseString(std::string input) { diff --git a/src/symbol/SymbolType.cpp b/src/symbol/SymbolType.cpp index 396568274..2da199ff1 100644 --- a/src/symbol/SymbolType.cpp +++ b/src/symbol/SymbolType.cpp @@ -53,10 +53,10 @@ SymbolType SymbolType::toArray(const CodeLoc &codeLoc, int size) const { * @return Base type */ SymbolType SymbolType::getContainedTy() const { - if (typeChain.empty()) // GCOV_EXCL_LINE - throw std::runtime_error("Internal compiler error: Cannot get contained type of empty type"); // GCOV_EXCL_LINE if (typeChain.top().superType == TY_STRING) return SymbolType(TY_CHAR); + if (typeChain.size() < 2) // GCOV_EXCL_LINE + throw std::runtime_error("Internal compiler error: Cannot get contained type of type with type chain < 2"); // GCOV_EXCL_LINE TypeChain newTypeChain = typeChain; newTypeChain.pop(); return SymbolType(newTypeChain); diff --git a/std/runtime/string_rt.spice b/std/runtime/string_rt.spice index 4378d5344..4fe0d51ca 100644 --- a/std/runtime/string_rt.spice +++ b/std/runtime/string_rt.spice @@ -1,3 +1,4 @@ +// Imports import "std/type/string" as str; // Constants @@ -10,23 +11,49 @@ ext realloc(byte*, int); ext free(byte*); ext memcpy(byte*, byte*, int); +// Generic types +type NumType int|long|short; + /** * String wrapper for enriching raw strings with information and make them mutable */ public type String struct { char* contents // Pointer to the first char - int capacity // Allocated number of chars - int length // Current number of chars + unsigned long capacity // Allocated number of chars + unsigned long length // Current number of chars } -public p String.ctor(string value = "") { +public p String.ctor(const string value = "") { + this.length = str.getRawLength(value); + this.capacity = this.length > INITIAL_ALLOC_COUNT ? this.length * RESIZE_FACTOR : INITIAL_ALLOC_COUNT; // +1 because of null terminator + // Allocate space for the initial number of elements - int itemSize = sizeof(type char); unsafe { - this.contents = (char*) malloc(itemSize * initAllocItems); + this.contents = (char*) malloc(sizeof(type char) * this.capacity); } - this.length = len(value); + + // Save initial value + unsafe { + for unsigned long i; i < this.length + 1; i++ { // +1 because of null terminator + this.contents[i] = value[i]; + } + } +} + +public p String.ctor(const char value) { + this.length = 1l; this.capacity = INITIAL_ALLOC_COUNT; + + // Allocate space for the initial number of elements + unsafe { + this.contents = (char*) malloc(sizeof(type char) * this.capacity); + } + + // Save initial value + unsafe { + this.contents[0] = value; + this.contents[1] = '\0'; + } } public p String.dtor() { @@ -39,16 +66,22 @@ public p String.dtor() { /** * Appends the given string wrapper to the current one * - * @param appendix String wrapper to be appended + * @param appendix string to be appended */ -public p String.append(String appendix) { - for int i = 0; i < appendix.length; i++ { - char charToAppend; - unsafe { - charToAppend = appendix.contents[i]; +public p String.append(const string appendix) { + unsigned long appendixLength = str.getRawLength(appendix); + // Check if we need to re-allocate memory + while this.capacity <= this.length + appendixLength { + this.resize(this.capacity * RESIZE_FACTOR); + } + + // Save data + unsafe { + for int i = 0; i < appendixLength + 1; i++ { // +1 because of null terminator + this.contents[this.length++] = appendix[i]; } - this.appendChar(charToAppend); } + this.length--; // Remove null terminator } /** @@ -56,25 +89,118 @@ public p String.append(String appendix) { * * @param c Char to append */ -public p String.appendChar(char c) { +public p String.appendChar(const char c) { // Check if we need to re-allocate memory - if this.length == this.capacity { + if this.capacity <= this.length + 1 { this.resize(this.capacity * RESIZE_FACTOR); } // Insert the char at the right position unsafe { - this.value[length++] = c; + this.contents[this.length++] = c; + this.contents[this.length] = '\0'; } } +/** + * Implements the add operator for 'string + string' + * + * @param operand String to be concatenated to the current one + */ +public inline p String.opAdd(const String operand) { + this.append(operand.getRaw()); +} + +/** + * Implements the multily operator for 'string * int/long/short' or 'int/long/short * int' + * + * @param operand Number of repetitions + */ +public p String.opMul(const NumType operand) { + // Cancel if operand is less than 2 + if operand < 2 { return; } + + unsigned long newLength = ((long) operand) * this.length; + // Check if we need to re-allocate memory + while this.capacity <= newLength { + this.resize(this.capacity * RESIZE_FACTOR); + } + + // Save the value + unsafe { + for int i = 0; i < newLength; i++ { + this.contents[i] = this.contents[i % this.length]; + } + this.contents[newLength + 1] = '\0'; + } + this.length = newLength; +} + +/** + * Implements the equals operator for 'string == string' + * + * @param operand String to comare the current string to + * + * @return Equal or not + */ +public inline f String.opEquals(const String operand) { + return this.opEquals(operand.getRaw()); +} + +/** + * Implements the equals operator for 'string == string' + * + * @param operand String to comare the current string to + * + * @return Equal or not + */ +public f String.opEquals(const string operand) { + // Compare sizes + if str.getRawLength(operand) != this.length { + return false; + } + + // Compare contents + unsafe { + for int i = 0; i < this.length; i++ { + if this.contents[i] != operand[i] { + return false; + } + } + } + + return true; +} + +/** + * Implements the equals operator for 'string != string' + * + * @param operand String to comare the current string to + * + * @return Equal or not + */ +public inline f String.opNotEquals(const String operand) { + return !this.opEquals(operand.getRaw()); +} + +/** + * Implements the equals operator for 'string != string' + * + * @param operand String to comare the current string to + * + * @return Equal or not + */ +public inline f String.opNotEquals(const string operand) { + return !this.opEquals(operand); +} + /** * Get the raw and immutable string from this container instance * * @return Raw immutable string */ -public f String.getRaw() { - return this.contents; +public inline f String.getRaw() { + return (string) this.contents; } /** @@ -82,7 +208,7 @@ public f String.getRaw() { * * @return Current length of the string */ -public f String.getLength() { +public inline f String.getLength() { return this.length; } @@ -91,8 +217,8 @@ public f String.getLength() { * * @return Current capacity of the string */ - public f String.getCapacity() { - return this.capacity; + public inline f String.getCapacity() { + return this.capacity - 1; // -1 because of null terminator } /** @@ -100,7 +226,7 @@ public f String.getLength() { * * @return Full or not full */ -public f String.isFull() { +public inline f String.isFull() { return this.length == this.capacity; } @@ -108,16 +234,18 @@ public f String.isFull() { * Replaces the current contents of the string with an empty string */ public p String.clear() { + this.length = 0l; unsafe { - this.contents = 0; + this.contents[0] = '\0'; } - this.length = 0; } /** * Reserves `charCount` items + * + * @param charCount Number of chars to reserve for the string */ -public p Queue.reserve(unsigned int charCount) { +public p String.reserve(unsigned long charCount) { if charCount > this.capacity { this.resize(charCount); } diff --git a/std/runtime/thread_rt.spice b/std/runtime/thread_rt.spice index 3c92a809b..d64275a79 100644 --- a/std/runtime/thread_rt.spice +++ b/std/runtime/thread_rt.spice @@ -1,3 +1,4 @@ +// Imports import "std/time/delay" as delay; import "std/os/cpu" as cpu; @@ -5,6 +6,9 @@ type Mutex struct { bool occupied } +/** + * Acquire the mutex + */ p Mutex.acquire() { while this.occupied { cpu.yield(); @@ -12,6 +16,9 @@ p Mutex.acquire() { this.occupied = true; } -p Mutex.abandon() { +/** + * Release the mutex + */ +p Mutex.release() { this.occupied = false; } \ No newline at end of file diff --git a/std/type/string.spice b/std/type/string.spice index a9191d79a..146b3d8f4 100644 --- a/std/type/string.spice +++ b/std/type/string.spice @@ -68,13 +68,9 @@ public f toBool(string input) { } // Returns the length of a string -public f len(string input) { - //for result = 0; input[result] != '\0'; result++ {} - return 0; -} - -// Returns true if the input string contains the input substring -public f contains(string input, string substring) { - // ToDo: implement - return false; +public f getRawLength(string input) { + result = 0l; + while input[result] != '\0' { + result++; + } } \ No newline at end of file diff --git a/test/StdTest.cpp b/test/StdTest.cpp index 6b6cbf3d8..a8091fe18 100644 --- a/test/StdTest.cpp +++ b/test/StdTest.cpp @@ -283,6 +283,7 @@ class StdDataTests : public ::testing::TestWithParam {}; class StdExamplesTests : public ::testing::TestWithParam {}; class StdIOTests : public ::testing::TestWithParam {}; class StdOSTests : public ::testing::TestWithParam {}; +class StdRuntimeTests : public ::testing::TestWithParam {}; class StdTextTests : public ::testing::TestWithParam {}; // Test macros @@ -290,6 +291,7 @@ TEST_P(StdDataTests, DataTests) { executeStdTest(GetParam()); } // NOLIN TEST_P(StdExamplesTests, ExamplesTests) { executeStdTest(GetParam()); } // NOLINT(cert-err58-cpp) TEST_P(StdIOTests, IOTests) { executeStdTest(GetParam()); } // NOLINT(cert-err58-cpp) TEST_P(StdOSTests, OSTests) { executeStdTest(GetParam()); } // NOLINT(cert-err58-cpp) +TEST_P(StdRuntimeTests, RuntimeTests) { executeStdTest(GetParam()); } // NOLINT(cert-err58-cpp) TEST_P(StdTextTests, TextTests) { executeStdTest(GetParam()); } // NOLINT(cert-err58-cpp) // Name resolver @@ -307,6 +309,7 @@ INSTANTIATE_TEST_SUITE_P(, StdDataTests, ::testing::ValuesIn(testSuites[0]), Nam INSTANTIATE_TEST_SUITE_P(, StdExamplesTests, ::testing::ValuesIn(testSuites[1]), NameResolver()); // NOLINT(cert-err58-cpp) INSTANTIATE_TEST_SUITE_P(, StdIOTests, ::testing::ValuesIn(testSuites[2]), NameResolver()); // NOLINT(cert-err58-cpp) INSTANTIATE_TEST_SUITE_P(, StdOSTests, ::testing::ValuesIn(testSuites[3]), NameResolver()); // NOLINT(cert-err58-cpp) -INSTANTIATE_TEST_SUITE_P(, StdTextTests, ::testing::ValuesIn(testSuites[4]), NameResolver()); // NOLINT(cert-err58-cpp) +INSTANTIATE_TEST_SUITE_P(, StdRuntimeTests, ::testing::ValuesIn(testSuites[4]), NameResolver()); // NOLINT(cert-err58-cpp) +INSTANTIATE_TEST_SUITE_P(, StdTextTests, ::testing::ValuesIn(testSuites[5]), NameResolver()); // NOLINT(cert-err58-cpp) // GCOV_EXCL_STOP \ No newline at end of file diff --git a/test/test-files/analyzer/arrays/array-index-not-type-int/exception.out b/test/test-files/analyzer/arrays/array-index-not-type-int/exception.out index 91c42d93a..cd2f5ddc4 100644 --- a/test/test-files/analyzer/arrays/array-index-not-type-int/exception.out +++ b/test/test-files/analyzer/arrays/array-index-not-type-int/exception.out @@ -1 +1 @@ -Semantic error in ./test-files/analyzer/arrays/array-index-not-type-int/source.spice:3:30: Array index not of type int: Array index must be of type int \ No newline at end of file +Semantic error in ./test-files/analyzer/arrays/array-index-not-type-int/source.spice:3:30: Array index not of type int or long: Array index must be of type int or long \ No newline at end of file diff --git a/test/test-files/analyzer/foreach-loops/error-foreach-wrong-index-type/exception.out b/test/test-files/analyzer/foreach-loops/error-foreach-wrong-index-type/exception.out index 44e06682f..c9b73c950 100644 --- a/test/test-files/analyzer/foreach-loops/error-foreach-wrong-index-type/exception.out +++ b/test/test-files/analyzer/foreach-loops/error-foreach-wrong-index-type/exception.out @@ -1 +1 @@ -Semantic error in ./test-files/analyzer/foreach-loops/error-foreach-wrong-index-type/source.spice:3:13: Array index not of type int: Index in foreach loop must be of type int. You provided double \ No newline at end of file +Semantic error in ./test-files/analyzer/foreach-loops/error-foreach-wrong-index-type/source.spice:3:13: Array index not of type int or long: Index in foreach loop must be of type int. You provided double \ No newline at end of file diff --git a/test/test-files/generator/arbitrary/success-ackermann/ir-code-O3.ll b/test/test-files/generator/arbitrary/success-ackermann/ir-code-O3.ll index 0d082b1e8..207b1968f 100644 --- a/test/test-files/generator/arbitrary/success-ackermann/ir-code-O3.ll +++ b/test/test-files/generator/arbitrary/success-ackermann/ir-code-O3.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [36 x i8] c"Ackermann of base m=%d and n=%d: %d\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-ackermann/ir-code.ll b/test/test-files/generator/arbitrary/success-ackermann/ir-code.ll index 65866904c..45e81a49f 100644 --- a/test/test-files/generator/arbitrary/success-ackermann/ir-code.ll +++ b/test/test-files/generator/arbitrary/success-ackermann/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [36 x i8] c"Ackermann of base m=%d and n=%d: %d\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-faculty/ir-code-O3.ll b/test/test-files/generator/arbitrary/success-faculty/ir-code-O3.ll index b11222dae..77df330c8 100644 --- a/test/test-files/generator/arbitrary/success-faculty/ir-code-O3.ll +++ b/test/test-files/generator/arbitrary/success-faculty/ir-code-O3.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [21 x i8] c"Faculty of %d is: %d\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-faculty/ir-code.ll b/test/test-files/generator/arbitrary/success-faculty/ir-code.ll index c02727a89..bdc9d9cef 100644 --- a/test/test-files/generator/arbitrary/success-faculty/ir-code.ll +++ b/test/test-files/generator/arbitrary/success-faculty/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [21 x i8] c"Faculty of %d is: %d\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-fibonacci-threaded/ir-code-O3.ll b/test/test-files/generator/arbitrary/success-fibonacci-threaded/ir-code-O3.ll index 72d6982b7..835e4ec57 100644 --- a/test/test-files/generator/arbitrary/success-fibonacci-threaded/ir-code-O3.ll +++ b/test/test-files/generator/arbitrary/success-fibonacci-threaded/ir-code-O3.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [33 x i8] c"Thread returned with result: %d\0A\00", align 1 @1 = private unnamed_addr constant [17 x i8] c"Program finished\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-fibonacci/ir-code-O3.ll b/test/test-files/generator/arbitrary/success-fibonacci/ir-code-O3.ll index 0be180d78..d4439c608 100644 --- a/test/test-files/generator/arbitrary/success-fibonacci/ir-code-O3.ll +++ b/test/test-files/generator/arbitrary/success-fibonacci/ir-code-O3.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [20 x i8] c"Fibonacci of %d: %d\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-fibonacci/ir-code.ll b/test/test-files/generator/arbitrary/success-fibonacci/ir-code.ll index 0e918d68a..d49f974b6 100644 --- a/test/test-files/generator/arbitrary/success-fibonacci/ir-code.ll +++ b/test/test-files/generator/arbitrary/success-fibonacci/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [20 x i8] c"Fibonacci of %d: %d\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-hello-world/ir-code-O2.ll b/test/test-files/generator/arbitrary/success-hello-world/ir-code-O2.ll index f08f4ce66..9df61dd56 100644 --- a/test/test-files/generator/arbitrary/success-hello-world/ir-code-O2.ll +++ b/test/test-files/generator/arbitrary/success-hello-world/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Hello World!\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-hello-world2/ir-code-O3.ll b/test/test-files/generator/arbitrary/success-hello-world2/ir-code-O3.ll index 87e9f3855..38986eb0a 100644 --- a/test/test-files/generator/arbitrary/success-hello-world2/ir-code-O3.ll +++ b/test/test-files/generator/arbitrary/success-hello-world2/ir-code-O3.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" ; Function Attrs: nofree nounwind define i32 @main() local_unnamed_addr #0 { diff --git a/test/test-files/generator/arbitrary/success-pidigits/ir-code-O3.ll b/test/test-files/generator/arbitrary/success-pidigits/ir-code-O3.ll index b00403733..3940ec52c 100644 --- a/test/test-files/generator/arbitrary/success-pidigits/ir-code-O3.ll +++ b/test/test-files/generator/arbitrary/success-pidigits/ir-code-O3.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 diff --git a/test/test-files/generator/arbitrary/success-pidigits/ir-code.ll b/test/test-files/generator/arbitrary/success-pidigits/ir-code.ll index bf240562c..b70dbe3b3 100644 --- a/test/test-files/generator/arbitrary/success-pidigits/ir-code.ll +++ b/test/test-files/generator/arbitrary/success-pidigits/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [3 x i8] c"%d\00", align 1 @1 = private unnamed_addr constant [2 x i8] c".\00", align 1 diff --git a/test/test-files/generator/arrays/success-arrays-dynamic-size/ir-code.ll b/test/test-files/generator/arrays/success-arrays-dynamic-size/ir-code.ll index f13ce3082..46a2853cd 100644 --- a/test/test-files/generator/arrays/success-arrays-dynamic-size/ir-code.ll +++ b/test/test-files/generator/arrays/success-arrays-dynamic-size/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [9 x i8] c"Array1:\0A\00", align 1 @1 = private unnamed_addr constant [10 x i8] c"Item: %d\0A\00", align 1 diff --git a/test/test-files/generator/arrays/success-arrays-multidimensional/ir-code.ll b/test/test-files/generator/arrays/success-arrays-multidimensional/ir-code.ll index f10ad3a05..ad6edaa1c 100644 --- a/test/test-files/generator/arrays/success-arrays-multidimensional/ir-code.ll +++ b/test/test-files/generator/arrays/success-arrays-multidimensional/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [15 x i8] c"Cell [1,3]: %d\00", align 1 diff --git a/test/test-files/generator/arrays/success-arrays/ir-code.ll b/test/test-files/generator/arrays/success-arrays/ir-code.ll index cf9b590b1..7746beaae 100644 --- a/test/test-files/generator/arrays/success-arrays/ir-code.ll +++ b/test/test-files/generator/arrays/success-arrays/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [23 x i8] c"Item 0: %d, item 2: %d\00", align 1 diff --git a/test/test-files/generator/arrays/success-arrays2/ir-code.ll b/test/test-files/generator/arrays/success-arrays2/ir-code.ll index a79da6efc..92a5de973 100644 --- a/test/test-files/generator/arrays/success-arrays2/ir-code.ll +++ b/test/test-files/generator/arrays/success-arrays2/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @intArray = global [10 x i32] [i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128, i32 256, i32 512] @0 = private unnamed_addr constant [17 x i8] c"intArray[3]: %d\0A\00", align 1 diff --git a/test/test-files/generator/arrays/success-arrays3/ir-code.ll b/test/test-files/generator/arrays/success-arrays3/ir-code.ll index 64a4f8aff..f1fccfbf1 100644 --- a/test/test-files/generator/arrays/success-arrays3/ir-code.ll +++ b/test/test-files/generator/arrays/success-arrays3/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @intArray = global [2 x i32] [i32 1, i32 2] @0 = private unnamed_addr constant [17 x i8] c"intArray[1]: %d\0A\00", align 1 diff --git a/test/test-files/generator/arrays/success-arrays4/ir-code.ll b/test/test-files/generator/arrays/success-arrays4/ir-code.ll index 6c924d24a..be323176b 100644 --- a/test/test-files/generator/arrays/success-arrays4/ir-code.ll +++ b/test/test-files/generator/arrays/success-arrays4/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [6 x i8] c"Hello\00", align 1 @1 = private unnamed_addr constant [6 x i8] c"Spice\00", align 1 diff --git a/test/test-files/generator/arrays/success-string-char-access/ir-code.ll b/test/test-files/generator/arrays/success-string-char-access/ir-code.ll index fd5db9ebe..83ef8ae6d 100644 --- a/test/test-files/generator/arrays/success-string-char-access/ir-code.ll +++ b/test/test-files/generator/arrays/success-string-char-access/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [5 x i8] c"test\00", align 1 @1 = private unnamed_addr constant [10 x i8] c"Char: %c\0A\00", align 1 diff --git a/test/test-files/generator/assertions/success-basic-assertion/ir-code.ll b/test/test-files/generator/assertions/success-basic-assertion/ir-code.ll index 751120e06..c8ae14855 100644 --- a/test/test-files/generator/assertions/success-basic-assertion/ir-code.ll +++ b/test/test-files/generator/assertions/success-basic-assertion/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [55 x i8] c"Assertion failed: Condition '1!=1' evaluated to false.\00", align 1 @1 = private unnamed_addr constant [12 x i8] c"Unreachable\00", align 1 diff --git a/test/test-files/generator/builtins/success-len/ir-code-O2.ll b/test/test-files/generator/builtins/success-len/ir-code-O2.ll index 50fb94da1..3c05ccfe9 100644 --- a/test/test-files/generator/builtins/success-len/ir-code-O2.ll +++ b/test/test-files/generator/builtins/success-len/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @testIntArray = local_unnamed_addr global [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 0, i32 0, i32 0] @0 = private unnamed_addr constant [18 x i8] c"Array length: %d\0A\00", align 1 diff --git a/test/test-files/generator/builtins/success-len/ir-code.ll b/test/test-files/generator/builtins/success-len/ir-code.ll index 4fff09541..f9a8a0267 100644 --- a/test/test-files/generator/builtins/success-len/ir-code.ll +++ b/test/test-files/generator/builtins/success-len/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @testIntArray = global [7 x i32] [i32 1, i32 2, i32 3, i32 4, i32 0, i32 0, i32 0] @0 = private unnamed_addr constant [18 x i8] c"Array length: %d\0A\00", align 1 diff --git a/test/test-files/generator/builtins/success-printf/ir-code-O2.ll b/test/test-files/generator/builtins/success-printf/ir-code-O2.ll index f08f4ce66..9df61dd56 100644 --- a/test/test-files/generator/builtins/success-printf/ir-code-O2.ll +++ b/test/test-files/generator/builtins/success-printf/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Hello World!\00", align 1 diff --git a/test/test-files/generator/builtins/success-printf/ir-code.ll b/test/test-files/generator/builtins/success-printf/ir-code.ll index 5e2cbdd4b..69b9a3284 100644 --- a/test/test-files/generator/builtins/success-printf/ir-code.ll +++ b/test/test-files/generator/builtins/success-printf/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Hello World!\00", align 1 diff --git a/test/test-files/generator/builtins/success-sizeof/ir-code-O2.ll b/test/test-files/generator/builtins/success-sizeof/ir-code-O2.ll index ffbf4a7d7..c2517e67d 100644 --- a/test/test-files/generator/builtins/success-sizeof/ir-code-O2.ll +++ b/test/test-files/generator/builtins/success-sizeof/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [20 x i8] c"Size of double: %d\0A\00", align 1 @1 = private unnamed_addr constant [17 x i8] c"Size of int: %d\0A\00", align 1 diff --git a/test/test-files/generator/builtins/success-sizeof/ir-code.ll b/test/test-files/generator/builtins/success-sizeof/ir-code.ll index cfa6e7066..996fd3807 100644 --- a/test/test-files/generator/builtins/success-sizeof/ir-code.ll +++ b/test/test-files/generator/builtins/success-sizeof/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [20 x i8] c"Size of double: %d\0A\00", align 1 @1 = private unnamed_addr constant [17 x i8] c"Size of int: %d\0A\00", align 1 diff --git a/test/test-files/generator/cli-args/success-cli-args/ir-code.ll b/test/test-files/generator/cli-args/success-cli-args/ir-code.ll index 329649574..457d1c0e7 100644 --- a/test/test-files/generator/cli-args/success-cli-args/ir-code.ll +++ b/test/test-files/generator/cli-args/success-cli-args/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"Argc: %d\0A\00", align 1 @1 = private unnamed_addr constant [16 x i8] c"Argv no. 0: %s\0A\00", align 1 diff --git a/test/test-files/generator/ext-decl/success-ext-decl/ir-code-O1.ll b/test/test-files/generator/ext-decl/success-ext-decl/ir-code-O1.ll index 0c11cdd15..53aa5ea9a 100644 --- a/test/test-files/generator/ext-decl/success-ext-decl/ir-code-O1.ll +++ b/test/test-files/generator/ext-decl/success-ext-decl/ir-code-O1.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [11 x i8] c"./test-dir\00", align 1 @1 = private unnamed_addr constant [6 x i8] c"Done.\00", align 1 diff --git a/test/test-files/generator/ext-decl/success-ext-decl/ir-code.ll b/test/test-files/generator/ext-decl/success-ext-decl/ir-code.ll index cbb11f672..8e0dfbcd5 100644 --- a/test/test-files/generator/ext-decl/success-ext-decl/ir-code.ll +++ b/test/test-files/generator/ext-decl/success-ext-decl/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @MODE_ALL_RWX = internal constant i32 511 @0 = private unnamed_addr constant [18 x i8] c"Creating dir ...\0A\00", align 1 diff --git a/test/test-files/generator/for-loops/success-for-loop-break/ir-code-O2.ll b/test/test-files/generator/for-loops/success-for-loop-break/ir-code-O2.ll index d3da0526a..97b3eb920 100644 --- a/test/test-files/generator/for-loops/success-for-loop-break/ir-code-O2.ll +++ b/test/test-files/generator/for-loops/success-for-loop-break/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Loop run %d\0A\00", align 1 @1 = private unnamed_addr constant [19 x i8] c"Inner loop run %d\0A\00", align 1 diff --git a/test/test-files/generator/for-loops/success-for-loop-break/ir-code.ll b/test/test-files/generator/for-loops/success-for-loop-break/ir-code.ll index d3f507a3a..373f4c94a 100644 --- a/test/test-files/generator/for-loops/success-for-loop-break/ir-code.ll +++ b/test/test-files/generator/for-loops/success-for-loop-break/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Loop run %d\0A\00", align 1 @1 = private unnamed_addr constant [19 x i8] c"Inner loop run %d\0A\00", align 1 diff --git a/test/test-files/generator/for-loops/success-for-loop-continue/ir-code-O2.ll b/test/test-files/generator/for-loops/success-for-loop-continue/ir-code-O2.ll index c02408ff7..c8c3f979a 100644 --- a/test/test-files/generator/for-loops/success-for-loop-continue/ir-code-O2.ll +++ b/test/test-files/generator/for-loops/success-for-loop-continue/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Loop run %d\0A\00", align 1 @1 = private unnamed_addr constant [19 x i8] c"Inner loop run %d\0A\00", align 1 diff --git a/test/test-files/generator/for-loops/success-for-loop-continue/ir-code.ll b/test/test-files/generator/for-loops/success-for-loop-continue/ir-code.ll index 79e3ec1b9..313d8b952 100644 --- a/test/test-files/generator/for-loops/success-for-loop-continue/ir-code.ll +++ b/test/test-files/generator/for-loops/success-for-loop-continue/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Loop run %d\0A\00", align 1 @1 = private unnamed_addr constant [19 x i8] c"Inner loop run %d\0A\00", align 1 diff --git a/test/test-files/generator/for-loops/success-for-loop/ir-code.ll b/test/test-files/generator/for-loops/success-for-loop/ir-code.ll index 4846a6ee8..caaa4f9e5 100644 --- a/test/test-files/generator/for-loops/success-for-loop/ir-code.ll +++ b/test/test-files/generator/for-loops/success-for-loop/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [9 x i8] c"Step %d\0A\00", align 1 diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-array-in-place/ir-code.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-array-in-place/ir-code.ll index 59a771d86..9b03353be 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-array-in-place/ir-code.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-array-in-place/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @anonymous.0 = global [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5] @0 = private unnamed_addr constant [13 x i8] c"Item %d: %d\0A\00", align 1 diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code-O2.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code-O2.ll index e30256333..60b18f717 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code-O2.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"Short %d\0A\00", align 1 @anonymous.0 = local_unnamed_addr global [2 x i64] [i64 1, i64 2] diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code.ll index a170304fb..0a566da92 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-break/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"Short %d\0A\00", align 1 @anonymous.0 = global [2 x i64] [i64 1, i64 2] diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code-O2.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code-O2.ll index 17dc1519c..d15687041 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code-O2.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"Short %d\0A\00", align 1 @anonymous.0 = local_unnamed_addr global [2 x i64] [i64 1, i64 2] diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code.ll index e7d431331..8f8b5bd74 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-continue/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"Short %d\0A\00", align 1 @anonymous.0 = global [2 x i64] [i64 1, i64 2] diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-indexed-modified/ir-code.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-indexed-modified/ir-code.ll index 8d2157099..81fb6d99b 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-indexed-modified/ir-code.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-indexed-modified/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @intArray = global [7 x i32] [i32 1, i32 5, i32 4, i32 0, i32 12, i32 12345, i32 9] @0 = private unnamed_addr constant [23 x i8] c"Item for index %d, %d\0A\00", align 1 diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-indexed/ir-code.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-indexed/ir-code.ll index 4ad942d6e..b02320b31 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-indexed/ir-code.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-indexed/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @intArray = global [7 x i32] [i32 1, i32 5, i32 4, i32 0, i32 12, i32 12345, i32 9] @0 = private unnamed_addr constant [23 x i8] c"Item for index %d, %d\0A\00", align 1 diff --git a/test/test-files/generator/foreach-loops/success-foreach-loop-normal/ir-code.ll b/test/test-files/generator/foreach-loops/success-foreach-loop-normal/ir-code.ll index 763253a59..033226ebd 100644 --- a/test/test-files/generator/foreach-loops/success-foreach-loop-normal/ir-code.ll +++ b/test/test-files/generator/foreach-loops/success-foreach-loop-normal/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @intArray = global [7 x i32] [i32 1, i32 5, i32 4, i32 0, i32 12, i32 12345, i32 9] @0 = private unnamed_addr constant [22 x i8] c"Item at index %d: %d\0A\00", align 1 diff --git a/test/test-files/generator/functions/success-default-arg-value-expressions/ir-code.ll b/test/test-files/generator/functions/success-default-arg-value-expressions/ir-code.ll index 47dd8b956..5d2c4292e 100644 --- a/test/test-files/generator/functions/success-default-arg-value-expressions/ir-code.ll +++ b/test/test-files/generator/functions/success-default-arg-value-expressions/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"Test: %f\0A\00", align 1 diff --git a/test/test-files/generator/functions/success-default-arg-values/ir-code.ll b/test/test-files/generator/functions/success-default-arg-values/ir-code.ll index 3d23dbc4b..63b8aeda8 100644 --- a/test/test-files/generator/functions/success-default-arg-values/ir-code.ll +++ b/test/test-files/generator/functions/success-default-arg-values/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [5 x i8] c"Test\00", align 1 @1 = private unnamed_addr constant [12 x i8] c"Result: %s\0A\00", align 1 diff --git a/test/test-files/generator/functions/success-down-call/ir-code.ll b/test/test-files/generator/functions/success-down-call/ir-code.ll index a0a25bc72..432ff2d66 100644 --- a/test/test-files/generator/functions/success-down-call/ir-code.ll +++ b/test/test-files/generator/functions/success-down-call/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [11 x i8] c"Result: %d\00", align 1 diff --git a/test/test-files/generator/functions/success-explicit-inlining/ir-code-O2.ll b/test/test-files/generator/functions/success-explicit-inlining/ir-code-O2.ll index f755a1ead..723122d94 100644 --- a/test/test-files/generator/functions/success-explicit-inlining/ir-code-O2.ll +++ b/test/test-files/generator/functions/success-explicit-inlining/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [19 x i8] c"Inlined value: %d\0A\00", align 1 diff --git a/test/test-files/generator/functions/success-explicit-inlining/ir-code.ll b/test/test-files/generator/functions/success-explicit-inlining/ir-code.ll index af4463520..d53ca717d 100644 --- a/test/test-files/generator/functions/success-explicit-inlining/ir-code.ll +++ b/test/test-files/generator/functions/success-explicit-inlining/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [19 x i8] c"Inlined value: %d\0A\00", align 1 diff --git a/test/test-files/generator/functions/success-overloading/ir-code.ll b/test/test-files/generator/functions/success-overloading/ir-code.ll index 131a8b06d..08ff211a0 100644 --- a/test/test-files/generator/functions/success-overloading/ir-code.ll +++ b/test/test-files/generator/functions/success-overloading/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [13 x i8] c"Test func 1\0A\00", align 1 @1 = private unnamed_addr constant [12 x i8] c"Result: %d\0A\00", align 1 diff --git a/test/test-files/generator/functions/success-result-variable/ir-code.ll b/test/test-files/generator/functions/success-result-variable/ir-code.ll index db118b7bc..737eb3754 100644 --- a/test/test-files/generator/functions/success-result-variable/ir-code.ll +++ b/test/test-files/generator/functions/success-result-variable/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [15 x i8] c"The age is: %d\00", align 1 diff --git a/test/test-files/generator/generics/success-external-generic-functions/ir-code.ll b/test/test-files/generator/generics/success-external-generic-functions/ir-code.ll index 63a589aa5..bbdccb0be 100644 --- a/test/test-files/generator/generics/success-external-generic-functions/ir-code.ll +++ b/test/test-files/generator/generics/success-external-generic-functions/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [6 x i8] c"Hello\00", align 1 @1 = private unnamed_addr constant [6 x i8] c"World\00", align 1 diff --git a/test/test-files/generator/generics/success-generic-functions/ir-code.ll b/test/test-files/generator/generics/success-generic-functions/ir-code.ll index c536a7ab4..72e7f8fc4 100644 --- a/test/test-files/generator/generics/success-generic-functions/ir-code.ll +++ b/test/test-files/generator/generics/success-generic-functions/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 @1 = private unnamed_addr constant [4 x i8] c"%f\0A\00", align 1 diff --git a/test/test-files/generator/generics/success-generic-functions2/ir-code.ll b/test/test-files/generator/generics/success-generic-functions2/ir-code.ll index 41f932def..97804dde5 100644 --- a/test/test-files/generator/generics/success-generic-functions2/ir-code.ll +++ b/test/test-files/generator/generics/success-generic-functions2/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"Data: %d\0A\00", align 1 @numberList1 = global [7 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7] diff --git a/test/test-files/generator/generics/success-generic-structs/ir-code.ll b/test/test-files/generator/generics/success-generic-structs/ir-code.ll index ee0905039..684fcb166 100644 --- a/test/test-files/generator/generics/success-generic-structs/ir-code.ll +++ b/test/test-files/generator/generics/success-generic-structs/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__double__Vector__doubleptr_int = type { ptr, i32 } diff --git a/test/test-files/generator/if-stmts/success-if-else-stmt/ir-code.ll b/test/test-files/generator/if-stmts/success-if-else-stmt/ir-code.ll index e1ecaeb00..8e1e0fbc2 100644 --- a/test/test-files/generator/if-stmts/success-if-else-stmt/ir-code.ll +++ b/test/test-files/generator/if-stmts/success-if-else-stmt/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [10 x i8] c"If branch\00", align 1 @1 = private unnamed_addr constant [10 x i8] c"Else if 1\00", align 1 diff --git a/test/test-files/generator/if-stmts/success-if-stmt/ir-code.ll b/test/test-files/generator/if-stmts/success-if-stmt/ir-code.ll index a95130513..f70ecf65d 100644 --- a/test/test-files/generator/if-stmts/success-if-stmt/ir-code.ll +++ b/test/test-files/generator/if-stmts/success-if-stmt/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [16 x i8] c"Condition true\0A\00", align 1 @1 = private unnamed_addr constant [17 x i8] c"Condition false\0A\00", align 1 diff --git a/test/test-files/generator/imports/success-modules-std/ir-code.ll b/test/test-files/generator/imports/success-modules-std/ir-code.ll index bbdc534b9..53b2a8342 100644 --- a/test/test-files/generator/imports/success-modules-std/ir-code.ll +++ b/test/test-files/generator/imports/success-modules-std/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [12 x i8] c"Result: %d\0A\00", align 1 diff --git a/test/test-files/generator/imports/success-modules/ir-code.ll b/test/test-files/generator/imports/success-modules/ir-code.ll index bb4d8cdcf..1a4a9bb2d 100644 --- a/test/test-files/generator/imports/success-modules/ir-code.ll +++ b/test/test-files/generator/imports/success-modules/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [11 x i8] c"Result: %d\00", align 1 diff --git a/test/test-files/generator/methods/success-method-down-up-call/ir-code.ll b/test/test-files/generator/methods/success-method-down-up-call/ir-code.ll index 46bbba7dc..288a52cfd 100644 --- a/test/test-files/generator/methods/success-method-down-up-call/ir-code.ll +++ b/test/test-files/generator/methods/success-method-down-up-call/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__char__TestStruct__char_int = type { i8, i32 } diff --git a/test/test-files/generator/methods/success-methods/ir-code.ll b/test/test-files/generator/methods/success-methods/ir-code.ll index cfe788316..63d1b68cf 100644 --- a/test/test-files/generator/methods/success-methods/ir-code.ll +++ b/test/test-files/generator/methods/success-methods/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__Letter__string = type { ptr } diff --git a/test/test-files/generator/operators/success-operators/ir-code.ll b/test/test-files/generator/operators/success-operators/ir-code.ll index 97486eb44..6073994fc 100644 --- a/test/test-files/generator/operators/success-operators/ir-code.ll +++ b/test/test-files/generator/operators/success-operators/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [11 x i8] c"Value: %d\0A\00", align 1 diff --git a/test/test-files/generator/operators/success-operators2/ir-code.ll b/test/test-files/generator/operators/success-operators2/ir-code.ll index 1c84afb74..13ff7b58b 100644 --- a/test/test-files/generator/operators/success-operators2/ir-code.ll +++ b/test/test-files/generator/operators/success-operators2/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [14 x i8] c"Result 1: %d\0A\00", align 1 @1 = private unnamed_addr constant [14 x i8] c"Result 2: %d\0A\00", align 1 diff --git a/test/test-files/generator/operators/success-short-circuiting/ir-code.ll b/test/test-files/generator/operators/success-short-circuiting/ir-code.ll index 479d48906..dcf2deef3 100644 --- a/test/test-files/generator/operators/success-short-circuiting/ir-code.ll +++ b/test/test-files/generator/operators/success-short-circuiting/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [15 x i8] c"Function True\0A\00", align 1 @1 = private unnamed_addr constant [16 x i8] c"Function False\0A\00", align 1 diff --git a/test/test-files/generator/pointers/success-nested-pointers/ir-code.ll b/test/test-files/generator/pointers/success-nested-pointers/ir-code.ll index c69e2a647..3971783d3 100644 --- a/test/test-files/generator/pointers/success-nested-pointers/ir-code.ll +++ b/test/test-files/generator/pointers/success-nested-pointers/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [7 x i8] c"1: %d\0A\00", align 1 @1 = private unnamed_addr constant [7 x i8] c"2: %d\0A\00", align 1 diff --git a/test/test-files/generator/pointers/success-pointer-functions/ir-code.ll b/test/test-files/generator/pointers/success-pointer-functions/ir-code.ll index b0117631c..5a2717619 100644 --- a/test/test-files/generator/pointers/success-pointer-functions/ir-code.ll +++ b/test/test-files/generator/pointers/success-pointer-functions/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__Person__string_string_int = type { ptr, ptr, i32 } diff --git a/test/test-files/generator/pointers/success-pointer/ir-code.ll b/test/test-files/generator/pointers/success-pointer/ir-code.ll index 8adb44430..9b8855b82 100644 --- a/test/test-files/generator/pointers/success-pointer/ir-code.ll +++ b/test/test-files/generator/pointers/success-pointer/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [6 x i8] c"Pizza\00", align 1 @1 = private unnamed_addr constant [31 x i8] c"Pointer address: %p, value: %s\00", align 1 diff --git a/test/test-files/generator/procedures/success-early-return/ir-code.ll b/test/test-files/generator/procedures/success-early-return/ir-code.ll index 99a8287ff..d6fe0a7bc 100644 --- a/test/test-files/generator/procedures/success-early-return/ir-code.ll +++ b/test/test-files/generator/procedures/success-early-return/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [16 x i8] c"Input was false\00", align 1 diff --git a/test/test-files/generator/procedures/success-explicit-inlining/ir-code-O2.ll b/test/test-files/generator/procedures/success-explicit-inlining/ir-code-O2.ll index 0f8ebcedc..2fdd2f1f3 100644 --- a/test/test-files/generator/procedures/success-explicit-inlining/ir-code-O2.ll +++ b/test/test-files/generator/procedures/success-explicit-inlining/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [21 x i8] c"This is a value: %d\0A\00", align 1 @str = private unnamed_addr constant [13 x i8] c"Before value\00", align 1 diff --git a/test/test-files/generator/procedures/success-explicit-inlining/ir-code.ll b/test/test-files/generator/procedures/success-explicit-inlining/ir-code.ll index 064d8e094..737cf42ab 100644 --- a/test/test-files/generator/procedures/success-explicit-inlining/ir-code.ll +++ b/test/test-files/generator/procedures/success-explicit-inlining/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [21 x i8] c"This is a value: %d\0A\00", align 1 @1 = private unnamed_addr constant [14 x i8] c"Before value\0A\00", align 1 diff --git a/test/test-files/generator/structs/success-constructors/ir-code.ll b/test/test-files/generator/structs/success-constructors/ir-code.ll index 59f9911f6..ec014fd07 100644 --- a/test/test-files/generator/structs/success-constructors/ir-code.ll +++ b/test/test-files/generator/structs/success-constructors/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__Vector__bool_string = type { i1, ptr } diff --git a/test/test-files/generator/structs/success-external-nested-struct/ir-code.ll b/test/test-files/generator/structs/success-external-nested-struct/ir-code.ll index bb8b9d2d2..1422ff838 100644 --- a/test/test-files/generator/structs/success-external-nested-struct/ir-code.ll +++ b/test/test-files/generator/structs/success-external-nested-struct/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__Socket__int_short_NestedSocket = type { i32, i16, %_s__NestedSocket__string_long } %_s__NestedSocket__string_long = type { ptr, i64 } diff --git a/test/test-files/generator/structs/success-external-structs/ir-code.ll b/test/test-files/generator/structs/success-external-structs/ir-code.ll index 53b251594..c7abfc14f 100644 --- a/test/test-files/generator/structs/success-external-structs/ir-code.ll +++ b/test/test-files/generator/structs/success-external-structs/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__Vec__int_bool = type { i32, i1 } diff --git a/test/test-files/generator/structs/success-struct-field-access/ir-code.ll b/test/test-files/generator/structs/success-struct-field-access/ir-code.ll index 615307538..784005cca 100644 --- a/test/test-files/generator/structs/success-struct-field-access/ir-code.ll +++ b/test/test-files/generator/structs/success-struct-field-access/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__Person__string_string_int = type { ptr, ptr, i32 } diff --git a/test/test-files/generator/structs/success-struct-in-place/ir-code.ll b/test/test-files/generator/structs/success-struct-in-place/ir-code.ll index 04c798978..2e1034859 100644 --- a/test/test-files/generator/structs/success-struct-in-place/ir-code.ll +++ b/test/test-files/generator/structs/success-struct-in-place/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__ShoppingCart__string_ShoppingItemarray = type { ptr, [3 x %_s__ShoppingItem__string_double_string] } %_s__ShoppingItem__string_double_string = type { ptr, double, ptr } diff --git a/test/test-files/generator/structs/success-struct-self-ref/ir-code.ll b/test/test-files/generator/structs/success-struct-self-ref/ir-code.ll index 8c5417ea5..e13fc5721 100644 --- a/test/test-files/generator/structs/success-struct-self-ref/ir-code.ll +++ b/test/test-files/generator/structs/success-struct-self-ref/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__TreeNode__TreeNodeptr_int = type { ptr, i32 } diff --git a/test/test-files/generator/structs/success-struct/ir-code.ll b/test/test-files/generator/structs/success-struct/ir-code.ll index 99a787004..89106cded 100644 --- a/test/test-files/generator/structs/success-struct/ir-code.ll +++ b/test/test-files/generator/structs/success-struct/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__Nested__string_boolptr = type { ptr, ptr } %_s__TestStruct__intptr_double_Nestedptr = type { ptr, double, ptr } diff --git a/test/test-files/generator/ternary/success-ternary-short-circuiting/ir-code.ll b/test/test-files/generator/ternary/success-ternary-short-circuiting/ir-code.ll index d9919409c..1cfd51b80 100644 --- a/test/test-files/generator/ternary/success-ternary-short-circuiting/ir-code.ll +++ b/test/test-files/generator/ternary/success-ternary-short-circuiting/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [11 x i8] c"Result: %d\00", align 1 diff --git a/test/test-files/generator/ternary/success-ternary-stmt/ir-code.ll b/test/test-files/generator/ternary/success-ternary-stmt/ir-code.ll index d1e79bb35..314646207 100644 --- a/test/test-files/generator/ternary/success-ternary-stmt/ir-code.ll +++ b/test/test-files/generator/ternary/success-ternary-stmt/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [11 x i8] c"Result: %d\00", align 1 diff --git a/test/test-files/generator/threads/success-basic-threads/ir-code-O2.ll b/test/test-files/generator/threads/success-basic-threads/ir-code-O2.ll index 5c525f313..1e1d0a2c6 100644 --- a/test/test-files/generator/threads/success-basic-threads/ir-code-O2.ll +++ b/test/test-files/generator/threads/success-basic-threads/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @str = private unnamed_addr constant [24 x i8] c"Starting one thread ...\00", align 1 @str.1 = private unnamed_addr constant [20 x i8] c"Hello from original\00", align 1 diff --git a/test/test-files/generator/threads/success-basic-threads/ir-code.ll b/test/test-files/generator/threads/success-basic-threads/ir-code.ll index be861494c..feb3a42b2 100644 --- a/test/test-files/generator/threads/success-basic-threads/ir-code.ll +++ b/test/test-files/generator/threads/success-basic-threads/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [25 x i8] c"Starting one thread ...\0A\00", align 1 @1 = private unnamed_addr constant [25 x i8] c"Hello from the thread 1\0A\00", align 1 diff --git a/test/test-files/generator/threads/success-thread-joining/ir-code-O2.ll b/test/test-files/generator/threads/success-thread-joining/ir-code-O2.ll index 771f1bcde..4600bb16c 100644 --- a/test/test-files/generator/threads/success-thread-joining/ir-code-O2.ll +++ b/test/test-files/generator/threads/success-thread-joining/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @str = private unnamed_addr constant [17 x i8] c"Program finished\00", align 1 @str.1 = private unnamed_addr constant [18 x i8] c"Thread 1 finished\00", align 1 diff --git a/test/test-files/generator/threads/success-thread-joining/ir-code.ll b/test/test-files/generator/threads/success-thread-joining/ir-code.ll index 680e416bb..34f807652 100644 --- a/test/test-files/generator/threads/success-thread-joining/ir-code.ll +++ b/test/test-files/generator/threads/success-thread-joining/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [19 x i8] c"Thread 1 finished\0A\00", align 1 @1 = private unnamed_addr constant [19 x i8] c"Thread 2 finished\0A\00", align 1 diff --git a/test/test-files/generator/threads/success-threads-captures1/ir-code-O2.ll b/test/test-files/generator/threads/success-threads-captures1/ir-code-O2.ll index b901784e1..25c2b7ffe 100644 --- a/test/test-files/generator/threads/success-threads-captures1/ir-code-O2.ll +++ b/test/test-files/generator/threads/success-threads-captures1/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [24 x i8] c"Starting thread %d ...\0A\00", align 1 @str = private unnamed_addr constant [21 x i8] c"Starting threads ...\00", align 1 diff --git a/test/test-files/generator/threads/success-threads-captures1/ir-code.ll b/test/test-files/generator/threads/success-threads-captures1/ir-code.ll index 384c141c1..c171d762d 100644 --- a/test/test-files/generator/threads/success-threads-captures1/ir-code.ll +++ b/test/test-files/generator/threads/success-threads-captures1/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [22 x i8] c"Starting threads ...\0A\00", align 1 @1 = private unnamed_addr constant [24 x i8] c"Starting thread %d ...\0A\00", align 1 diff --git a/test/test-files/generator/threads/success-threads-captures2/ir-code-O2.ll b/test/test-files/generator/threads/success-threads-captures2/ir-code-O2.ll index bb5cc19f3..1c58e46be 100644 --- a/test/test-files/generator/threads/success-threads-captures2/ir-code-O2.ll +++ b/test/test-files/generator/threads/success-threads-captures2/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [24 x i8] c"Starting thread %d ...\0A\00", align 1 @str = private unnamed_addr constant [21 x i8] c"Starting threads ...\00", align 1 diff --git a/test/test-files/generator/threads/success-threads-captures2/ir-code.ll b/test/test-files/generator/threads/success-threads-captures2/ir-code.ll index 4a6b2c7b0..9c7928000 100644 --- a/test/test-files/generator/threads/success-threads-captures2/ir-code.ll +++ b/test/test-files/generator/threads/success-threads-captures2/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [22 x i8] c"Starting threads ...\0A\00", align 1 @1 = private unnamed_addr constant [24 x i8] c"Starting thread %d ...\0A\00", align 1 diff --git a/test/test-files/generator/unsafe/success-pointer-cast/ir-code.ll b/test/test-files/generator/unsafe/success-pointer-cast/ir-code.ll index c03aaefd5..7ce9b477e 100644 --- a/test/test-files/generator/unsafe/success-pointer-cast/ir-code.ll +++ b/test/test-files/generator/unsafe/success-pointer-cast/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [9 x i8] c"Int: %d\0A\00", align 1 diff --git a/test/test-files/generator/variables/success-decl-default-value/ir-code.ll b/test/test-files/generator/variables/success-decl-default-value/ir-code.ll index 7beacda74..b021260e2 100644 --- a/test/test-files/generator/variables/success-decl-default-value/ir-code.ll +++ b/test/test-files/generator/variables/success-decl-default-value/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__NestedStruct__int_string = type { i32, ptr } diff --git a/test/test-files/generator/variables/success-external-global-var/ir-code.ll b/test/test-files/generator/variables/success-external-global-var/ir-code.ll index b982c246d..e26fb0848 100644 --- a/test/test-files/generator/variables/success-external-global-var/ir-code.ll +++ b/test/test-files/generator/variables/success-external-global-var/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [16 x i8] c"Global var: %s\0A\00", align 1 @GLOBAL = external global ptr diff --git a/test/test-files/generator/variables/success-global-variables/ir-code.ll b/test/test-files/generator/variables/success-global-variables/ir-code.ll index b945fa4a0..b311e555f 100644 --- a/test/test-files/generator/variables/success-global-variables/ir-code.ll +++ b/test/test-files/generator/variables/success-global-variables/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @test1 = internal global i32 10 @test2 = internal global ptr @0 diff --git a/test/test-files/generator/while-loops/success-while-loop-break/ir-code-O2.ll b/test/test-files/generator/while-loops/success-while-loop-break/ir-code-O2.ll index 53cceb828..86d6e95c5 100644 --- a/test/test-files/generator/while-loops/success-while-loop-break/ir-code-O2.ll +++ b/test/test-files/generator/while-loops/success-while-loop-break/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [22 x i8] c"Outer: %f, inner: %d\0A\00", align 1 diff --git a/test/test-files/generator/while-loops/success-while-loop-break/ir-code.ll b/test/test-files/generator/while-loops/success-while-loop-break/ir-code.ll index 522ead7cb..00d06d540 100644 --- a/test/test-files/generator/while-loops/success-while-loop-break/ir-code.ll +++ b/test/test-files/generator/while-loops/success-while-loop-break/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [22 x i8] c"Outer: %f, inner: %d\0A\00", align 1 diff --git a/test/test-files/generator/while-loops/success-while-loop-continue/ir-code-O2.ll b/test/test-files/generator/while-loops/success-while-loop-continue/ir-code-O2.ll index 8817ce1fc..cc35d4c68 100644 --- a/test/test-files/generator/while-loops/success-while-loop-continue/ir-code-O2.ll +++ b/test/test-files/generator/while-loops/success-while-loop-continue/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [22 x i8] c"Outer: %f, inner: %d\0A\00", align 1 diff --git a/test/test-files/generator/while-loops/success-while-loop-continue/ir-code.ll b/test/test-files/generator/while-loops/success-while-loop-continue/ir-code.ll index bffd035c5..88f6d5bd1 100644 --- a/test/test-files/generator/while-loops/success-while-loop-continue/ir-code.ll +++ b/test/test-files/generator/while-loops/success-while-loop-continue/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [22 x i8] c"Outer: %f, inner: %d\0A\00", align 1 diff --git a/test/test-files/generator/while-loops/success-while-loop/ir-code.ll b/test/test-files/generator/while-loops/success-while-loop/ir-code.ll index a2678e9be..7fa14ffee 100644 --- a/test/test-files/generator/while-loops/success-while-loop/ir-code.ll +++ b/test/test-files/generator/while-loops/success-while-loop/ir-code.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [17 x i8] c"i is now at: %d\0A\00", align 1 diff --git a/test/test-files/std/data/pair-normal-usecase/ir-code-O2.ll b/test/test-files/std/data/pair-normal-usecase/ir-code-O2.ll index 9012291f3..8a56bf37e 100644 --- a/test/test-files/std/data/pair-normal-usecase/ir-code-O2.ll +++ b/test/test-files/std/data/pair-normal-usecase/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__string_int__Pair__string_int = type { ptr, i32 } diff --git a/test/test-files/std/data/queue-normal-usecase/ir-code-O2.ll b/test/test-files/std/data/queue-normal-usecase/ir-code-O2.ll index 5bd2248c5..6ed25e563 100644 --- a/test/test-files/std/data/queue-normal-usecase/ir-code-O2.ll +++ b/test/test-files/std/data/queue-normal-usecase/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__char__Queue__charptr_long_long_long_long_int = type { ptr, i64, i64, i64, i64, i32 } diff --git a/test/test-files/std/data/stack-normal-usecase/ir-code-O2.ll b/test/test-files/std/data/stack-normal-usecase/ir-code-O2.ll index e12ff5fa0..c9e6d45b1 100644 --- a/test/test-files/std/data/stack-normal-usecase/ir-code-O2.ll +++ b/test/test-files/std/data/stack-normal-usecase/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__int__Stack__intptr_long_long_int = type { ptr, i64, i64, i32 } diff --git a/test/test-files/std/data/triple-normal-usecase/ir-code-O2.ll b/test/test-files/std/data/triple-normal-usecase/ir-code-O2.ll index 36fbc77fe..313f30b21 100644 --- a/test/test-files/std/data/triple-normal-usecase/ir-code-O2.ll +++ b/test/test-files/std/data/triple-normal-usecase/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__string_int_bool__Triple__string_int_bool = type { ptr, i32, i1 } diff --git a/test/test-files/std/data/vector-normal-usecase/ir-code-O2.ll b/test/test-files/std/data/vector-normal-usecase/ir-code-O2.ll index 777f1cbb4..13b3b6573 100644 --- a/test/test-files/std/data/vector-normal-usecase/ir-code-O2.ll +++ b/test/test-files/std/data/vector-normal-usecase/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" %_s__double__Vector__doubleptr_long_long_int = type { ptr, i64, i64, i32 } diff --git a/test/test-files/std/io/mkdir-rmdir-direxists/ir-code-O2.ll b/test/test-files/std/io/mkdir-rmdir-direxists/ir-code-O2.ll index ff196de33..319df54a0 100644 --- a/test/test-files/std/io/mkdir-rmdir-direxists/ir-code-O2.ll +++ b/test/test-files/std/io/mkdir-rmdir-direxists/ir-code-O2.ll @@ -1,7 +1,7 @@ ; ModuleID = 'source.spice' source_filename = "source.spice" -target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" -target triple = "x86_64-unknown-linux-gnu" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" @0 = private unnamed_addr constant [28 x i8] c"Existing before create: %d\0A\00", align 1 @MODE_ALL_RWX = external local_unnamed_addr global i32 diff --git a/test/test-files/std/runtime/string-basic-operations/cout.out b/test/test-files/std/runtime/string-basic-operations/cout.out new file mode 100644 index 000000000..8d1ae3e16 --- /dev/null +++ b/test/test-files/std/runtime/string-basic-operations/cout.out @@ -0,0 +1,27 @@ +Content: Hello +Length: 6 +Capacity: 11 + +Content: Hello World! +Length: 12 +Capacity: 23 + +Content: Hello World!? +Length: 13 +Capacity: 23 + +Content: Hello World!?! +Length: 14 +Capacity: 23 + +Equals: 1 +Equals: 0 +Not Equals: 0 +Not Equals: 1 +Content: +Length: 0 +Capacity: 23 + +Content: +Length: 0 +Capacity: 99 \ No newline at end of file diff --git a/test/test-files/std/runtime/string-basic-operations/ir-code-O2.ll b/test/test-files/std/runtime/string-basic-operations/ir-code-O2.ll new file mode 100644 index 000000000..e12dbfa46 --- /dev/null +++ b/test/test-files/std/runtime/string-basic-operations/ir-code-O2.ll @@ -0,0 +1,102 @@ +; ModuleID = 'source.spice' +source_filename = "source.spice" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" + +%_s__String__charptr_long_long = type { ptr, i64, i64 } + +@0 = private unnamed_addr constant [7 x i8] c"Hello \00", align 1 +@1 = private unnamed_addr constant [7 x i8] c"World!\00", align 1 +@2 = private unnamed_addr constant [12 x i8] c"Equals: %d\0A\00", align 1 +@3 = private unnamed_addr constant [15 x i8] c"Hello World!?!\00", align 1 +@4 = private unnamed_addr constant [16 x i8] c"Not Equals: %d\0A\00", align 1 +@5 = private unnamed_addr constant [14 x i8] c"Hello World!!\00", align 1 +@6 = private unnamed_addr constant [15 x i8] c"Capacity: %d\0A\0A\00", align 1 +@7 = private unnamed_addr constant [13 x i8] c"Content: %s\0A\00", align 1 +@8 = private unnamed_addr constant [12 x i8] c"Length: %d\0A\00", align 1 +@9 = private unnamed_addr constant [13 x i8] c"Capacity: %d\00", align 1 + +define i32 @main() local_unnamed_addr { +entry.l3: + %s = alloca %_s__String__charptr_long_long, align 8 + call void @_mp__String__ctor__string(ptr nonnull %s, ptr nonnull @0) + %0 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %1 = call i32 (ptr, ...) @printf(ptr nonnull @7, ptr %0) + %2 = call i64 @_mf__String__getLength(ptr nonnull %s) + %3 = call i32 (ptr, ...) @printf(ptr nonnull @8, i64 %2) + %4 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %5 = call i32 (ptr, ...) @printf(ptr nonnull @6, i64 %4) + call void @_mp__String__append__string(ptr nonnull %s, ptr nonnull @1) + %6 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %7 = call i32 (ptr, ...) @printf(ptr nonnull @7, ptr %6) + %8 = call i64 @_mf__String__getLength(ptr nonnull %s) + %9 = call i32 (ptr, ...) @printf(ptr nonnull @8, i64 %8) + %10 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %11 = call i32 (ptr, ...) @printf(ptr nonnull @6, i64 %10) + call void @_mp__String__appendChar__char(ptr nonnull %s, i8 63) + %12 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %13 = call i32 (ptr, ...) @printf(ptr nonnull @7, ptr %12) + %14 = call i64 @_mf__String__getLength(ptr nonnull %s) + %15 = call i32 (ptr, ...) @printf(ptr nonnull @8, i64 %14) + %16 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %17 = call i32 (ptr, ...) @printf(ptr nonnull @6, i64 %16) + call void @_mp__String__appendChar__char(ptr nonnull %s, i8 33) + %18 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %19 = call i32 (ptr, ...) @printf(ptr nonnull @7, ptr %18) + %20 = call i64 @_mf__String__getLength(ptr nonnull %s) + %21 = call i32 (ptr, ...) @printf(ptr nonnull @8, i64 %20) + %22 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %23 = call i32 (ptr, ...) @printf(ptr nonnull @6, i64 %22) + %24 = call i1 @_mf__String__opEquals__string(ptr nonnull %s, ptr nonnull @3) + %25 = zext i1 %24 to i32 + %26 = call i32 (ptr, ...) @printf(ptr nonnull @2, i32 %25) + %27 = call i1 @_mf__String__opEquals__string(ptr nonnull %s, ptr nonnull @5) + %28 = zext i1 %27 to i32 + %29 = call i32 (ptr, ...) @printf(ptr nonnull @2, i32 %28) + %30 = call i1 @_mf__String__opNotEquals__string(ptr nonnull %s, ptr nonnull @3) + %31 = zext i1 %30 to i32 + %32 = call i32 (ptr, ...) @printf(ptr nonnull @4, i32 %31) + %33 = call i1 @_mf__String__opNotEquals__string(ptr nonnull %s, ptr nonnull @5) + %34 = zext i1 %33 to i32 + %35 = call i32 (ptr, ...) @printf(ptr nonnull @4, i32 %34) + call void @_mp__String__clear(ptr nonnull %s) + %36 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %37 = call i32 (ptr, ...) @printf(ptr nonnull @7, ptr %36) + %38 = call i64 @_mf__String__getLength(ptr nonnull %s) + %39 = call i32 (ptr, ...) @printf(ptr nonnull @8, i64 %38) + %40 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %41 = call i32 (ptr, ...) @printf(ptr nonnull @6, i64 %40) + call void @_mp__String__reserve__long(ptr nonnull %s, i64 100) + %42 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %43 = call i32 (ptr, ...) @printf(ptr nonnull @7, ptr %42) + %44 = call i64 @_mf__String__getLength(ptr nonnull %s) + %45 = call i32 (ptr, ...) @printf(ptr nonnull @8, i64 %44) + %46 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %47 = call i32 (ptr, ...) @printf(ptr nonnull @9, i64 %46) + ret i32 0 +} + +declare void @_mp__String__ctor__string(ptr, ptr) local_unnamed_addr + +; Function Attrs: nofree nounwind +declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0 + +declare ptr @_mf__String__getRaw(ptr) local_unnamed_addr + +declare i64 @_mf__String__getLength(ptr) local_unnamed_addr + +declare i64 @_mf__String__getCapacity(ptr) local_unnamed_addr + +declare void @_mp__String__append__string(ptr, ptr) local_unnamed_addr + +declare void @_mp__String__appendChar__char(ptr, i8) local_unnamed_addr + +declare i1 @_mf__String__opEquals__string(ptr, ptr) local_unnamed_addr + +declare i1 @_mf__String__opNotEquals__string(ptr, ptr) local_unnamed_addr + +declare void @_mp__String__clear(ptr) local_unnamed_addr + +declare void @_mp__String__reserve__long(ptr, i64) local_unnamed_addr + +attributes #0 = { nofree nounwind } diff --git a/test/test-files/std/runtime/string-basic-operations/source.spice b/test/test-files/std/runtime/string-basic-operations/source.spice new file mode 100644 index 000000000..abf4509b2 --- /dev/null +++ b/test/test-files/std/runtime/string-basic-operations/source.spice @@ -0,0 +1,32 @@ +import "std/runtime/string_rt" as _rt_str; + +f main() { + _rt_str::String s = _rt_str::String("Hello "); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d\n\n", s.getCapacity()); + s.append("World!"); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d\n\n", s.getCapacity()); + s.appendChar('?'); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d\n\n", s.getCapacity()); + s.appendChar('!'); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d\n\n", s.getCapacity()); + printf("Equals: %d\n", s.opEquals("Hello World!?!")); + printf("Equals: %d\n", s.opEquals("Hello World!!")); + printf("Not Equals: %d\n", s.opNotEquals("Hello World!?!")); + printf("Not Equals: %d\n", s.opNotEquals("Hello World!!")); + s.clear(); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d\n\n", s.getCapacity()); + s.reserve(100l); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d", s.getCapacity()); +} \ No newline at end of file diff --git a/test/test-files/std/runtime/string-char-ctor/cout.out b/test/test-files/std/runtime/string-char-ctor/cout.out new file mode 100644 index 000000000..683b6258c --- /dev/null +++ b/test/test-files/std/runtime/string-char-ctor/cout.out @@ -0,0 +1,8 @@ +Content: H +Length: 1 +Capacity: 4 + +Content: Hello +Length: 5 +Capacity: 9 + diff --git a/test/test-files/std/runtime/string-char-ctor/ir-code-O2.ll b/test/test-files/std/runtime/string-char-ctor/ir-code-O2.ll new file mode 100644 index 000000000..c36a9474e --- /dev/null +++ b/test/test-files/std/runtime/string-char-ctor/ir-code-O2.ll @@ -0,0 +1,46 @@ +; ModuleID = 'source.spice' +source_filename = "source.spice" +target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-w64-windows-gnu" + +%_s__String__charptr_long_long = type { ptr, i64, i64 } + +@0 = private unnamed_addr constant [5 x i8] c"ello\00", align 1 +@1 = private unnamed_addr constant [13 x i8] c"Content: %s\0A\00", align 1 +@2 = private unnamed_addr constant [12 x i8] c"Length: %d\0A\00", align 1 +@3 = private unnamed_addr constant [15 x i8] c"Capacity: %d\0A\0A\00", align 1 + +define i32 @main() local_unnamed_addr { +entry.l3: + %s = alloca %_s__String__charptr_long_long, align 8 + call void @_mp__String__ctor__char(ptr nonnull %s, i8 72) + %0 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %1 = call i32 (ptr, ...) @printf(ptr nonnull @1, ptr %0) + %2 = call i64 @_mf__String__getLength(ptr nonnull %s) + %3 = call i32 (ptr, ...) @printf(ptr nonnull @2, i64 %2) + %4 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %5 = call i32 (ptr, ...) @printf(ptr nonnull @3, i64 %4) + call void @_mp__String__append__string(ptr nonnull %s, ptr nonnull @0) + %6 = call ptr @_mf__String__getRaw(ptr nonnull %s) + %7 = call i32 (ptr, ...) @printf(ptr nonnull @1, ptr %6) + %8 = call i64 @_mf__String__getLength(ptr nonnull %s) + %9 = call i32 (ptr, ...) @printf(ptr nonnull @2, i64 %8) + %10 = call i64 @_mf__String__getCapacity(ptr nonnull %s) + %11 = call i32 (ptr, ...) @printf(ptr nonnull @3, i64 %10) + ret i32 0 +} + +declare void @_mp__String__ctor__char(ptr, i8) local_unnamed_addr + +; Function Attrs: nofree nounwind +declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #0 + +declare ptr @_mf__String__getRaw(ptr) local_unnamed_addr + +declare i64 @_mf__String__getLength(ptr) local_unnamed_addr + +declare i64 @_mf__String__getCapacity(ptr) local_unnamed_addr + +declare void @_mp__String__append__string(ptr, ptr) local_unnamed_addr + +attributes #0 = { nofree nounwind } diff --git a/test/test-files/std/runtime/string-char-ctor/source.spice b/test/test-files/std/runtime/string-char-ctor/source.spice new file mode 100644 index 000000000..9ac8e2422 --- /dev/null +++ b/test/test-files/std/runtime/string-char-ctor/source.spice @@ -0,0 +1,12 @@ +import "std/runtime/string_rt" as _rt_str; + +f main() { + _rt_str::String s = _rt_str::String('H'); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d\n\n", s.getCapacity()); + s.append("ello"); + printf("Content: %s\n", s.getRaw()); + printf("Length: %d\n", s.getLength()); + printf("Capacity: %d\n\n", s.getCapacity()); +} \ No newline at end of file