UI test error annotations!

This commit is contained in:
nora 2024-06-02 20:48:17 +02:00
parent 5e7e99982d
commit a0efca50e0
42 changed files with 437 additions and 694 deletions

View file

@ -2,6 +2,7 @@ function a(_a: I32) =
___asm(
__locals(),
0,
//~^ ERROR: inline assembly instruction must be string literal with instruction
);
function main() = ;

View file

@ -1,4 +1,4 @@
error: inline assembly instruction must be string literal with instruction
--> $DIR/instr_not_string.nil:4
--> ./ui-tests/asm/instr_not_string.nil:4
4 | 0,
^

View file

@ -2,6 +2,7 @@ function dropping(_a: I32) =
___asm(
__locals(),
"meow meow",
//~^ ERROR: unknown instruction: meow
);
function main() = ;

View file

@ -1,4 +1,4 @@
error: unknown instruction: meow
--> $DIR/invalid_instr.nil:4
--> ./ui-tests/asm/invalid_instr.nil:4
4 | "meow meow",
^^^^^^^^^^^

View file

@ -1,5 +1,6 @@
function dropping(_a: I32) =
___asm(
//~^ ERROR: inline assembly must have __locals() as first argument
"local.get 0",
"drop",
);

View file

@ -1,4 +1,4 @@
error: inline assembly must have __locals() as first argument
--> $DIR/missing_locals.nil:2
--> ./ui-tests/asm/missing_locals.nil:2
2 | ___asm(
^

View file

@ -1,6 +1,8 @@
function dropping(_a: I32) = (
1;
___asm(__locals(), "drop");
//~^ ERROR: `___asm` cannot be used as a value
//~| ERROR: `__locals` cannot be used as a value
);
function main() = ;

View file

@ -1,8 +1,8 @@
error: `___asm` cannot be used as a value
--> $DIR/not_toplevel.nil:3
--> ./ui-tests/asm/not_toplevel.nil:3
3 | ___asm(__locals(), "drop");
^^^^^^
error: `__locals` cannot be used as a value
--> $DIR/not_toplevel.nil:3
--> ./ui-tests/asm/not_toplevel.nil:3
3 | ___asm(__locals(), "drop");
^^^^^^^^

View file

@ -2,6 +2,7 @@ function a(_a: I32) =
___asm(
__locals(),
"local.get 0 0",
//~^ ERROR: mismatched immediate lengths, expected 1, got 2
"drop",
);
@ -9,6 +10,7 @@ function b(_a: I32) =
___asm(
__locals(),
"local.get",
//~^ ERROR: mismatched immediate lengths, expected 1, got 0
"drop",
);

View file

@ -1,8 +1,8 @@
error: mismatched immediate lengths, expected 1, got 2
--> $DIR/wrong_imm.nil:4
--> ./ui-tests/asm/wrong_imm.nil:4
4 | "local.get 0 0",
^^^^^^^^^^^^^^^
error: mismatched immediate lengths, expected 1, got 0
--> $DIR/wrong_imm.nil:11
11 | "local.get",
--> ./ui-tests/asm/wrong_imm.nil:12
12 | "local.get",
^^^^^^^^^^^