Skip to content

Commit

Permalink
[Test] remove pipefail to avoid shadowing crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
isuckatcs committed Jun 30, 2024
1 parent a3ac04e commit f60ea09
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
13 changes: 7 additions & 6 deletions src/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ int main(int argc, const char **argv) {
Sema sema{std::move(functions)};

auto resolvedFunctions = sema.resolveSourceFile();

if (options.resDump) {
for (auto &&fn : resolvedFunctions)
fn->dump();
return 0;
}

if (resolvedFunctions.empty())
return 1;

Expand All @@ -127,12 +134,6 @@ int main(int argc, const char **argv) {
return 0;
}

if (options.resDump) {
for (auto &&fn : resolvedFunctions)
fn->dump();
return 0;
}

Codegen codegen{std::move(resolvedFunctions)};
std::unique_ptr<llvm::Module> ir = codegen.generateIR();

Expand Down
1 change: 0 additions & 1 deletion test/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@

config.name = "how-to-compile-your-language"
config.test_format = lit.formats.ShTest(False if os.name == 'nt' else True)
config.pipefail = False

config.suffixes = ['.al']
2 changes: 1 addition & 1 deletion test/parser/error_recovery_eof.al
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// RUN: compiler %s 2>&1 | filecheck %s
// RUN: compiler %s 2>&1 -ast-dump | filecheck %s
// CHECK: [[# @LINE + 1 ]]:13: error: expected type specifier
fn error(): {
2 changes: 1 addition & 1 deletion test/parser/missing_semi.al
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: compiler %s 2>&1 | filecheck %s
// RUN: compiler %s 2>&1 -ast-dump | filecheck %s
fn main(): void {
1.0
// CHECK: [[# @LINE + 1 ]]:1: error: expected ';' at the end of statement
Expand Down
2 changes: 1 addition & 1 deletion test/parser/no_main_function.al
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// RUN: compiler %s 2>&1 | filecheck %s
// RUN: compiler %s 2>&1 -ast-dump | filecheck %s
// CHECK: [[# @LINE + 1 ]]:1: error: main function not found
2 changes: 1 addition & 1 deletion test/sema/builtin_print_fn_name_collision.al
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: compiler %s 2>&1 | filecheck %s
// RUN: compiler %s 2>&1 -res-dump | filecheck %s
fn main(): void {}

// CHECK: [[# @LINE + 1 ]]:1: error: redeclaration of 'print'
Expand Down
2 changes: 1 addition & 1 deletion test/sema/main_redeclared.al
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: compiler %s 2>&1 | filecheck %s
// RUN: compiler %s 2>&1 -res-dump | filecheck %s
fn main(): void {}

// CHECK: [[# @LINE + 1 ]]:1: error: redeclaration of 'main'
Expand Down
2 changes: 1 addition & 1 deletion test/sema/non_void_main.al
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
// RUN: compiler %s 2>&1 | filecheck %s
// RUN: compiler %s 2>&1 -res-dump | filecheck %s
// CHECK: [[# @LINE + 1 ]]:1: error: 'main' function is expected to have 'void' type
fn main(): number {}

0 comments on commit f60ea09

Please sign in to comment.