test: fix incorrect default target spec; port all incremental tests

This commit is contained in:
Jakub Konka
2022-04-27 15:37:54 +02:00
parent 133708d939
commit 97b781955e
102 changed files with 1360 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
// This additionally tests that the compile error reports the correct source location.
// Without storing source locations relative to the owner decl, the compile error
// here would be off by 2 bytes (from the "7" -> "999").
pub fn main() void {
const y = fibonacci(999);
if (y - 21 != 0) unreachable;
}
inline fn fibonacci(n: usize) usize {
if (n <= 2) return n;
return fibonacci(n - 2) + fibonacci(n - 1);
}
// error
//
// :11:21: error: evaluation exceeded 1000 backwards branches