compiler error when variable in asm template cannot be found

This commit is contained in:
Timon Kruiper
2019-08-17 14:16:51 +02:00
committed by Andrew Kelley
parent 2aa18b9097
commit 2addec8ea1
2 changed files with 47 additions and 0 deletions

View File

@@ -2,6 +2,18 @@ const tests = @import("tests.zig");
const builtin = @import("builtin");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
"variable in inline assembly template cannot be found",
\\export fn entry() void {
\\ var sp = asm volatile (
\\ "mov %[foo], sp"
\\ : [bar] "=r" (-> usize)
\\ );
\\}
,
"tmp.zig:2:14: error: could not find 'foo' in the inputs or outputs."
);
cases.add(
"indirect recursion of async functions detected",
\\var frame: ?anyframe = null;