Address Spaces: Address space on local variable test

This commit is contained in:
Robin Voetter 2021-08-27 04:26:05 +02:00
parent e77fcf1730
commit 6336f08c21

View File

@ -1807,4 +1807,16 @@ pub fn addCases(ctx: *TestContext) !void {
\\}
, "");
}
{
var case = ctx.exe("setting an address space on a local variable", linux_x64);
case.addError(
\\export fn entry() i32 {
\\ var foo: i32 addrspace(".general") = 1234;
\\ return foo;
\\}
, &[_][]const u8{
":2:28: error: cannot set address space of local variable 'foo'",
});
}
}