From 8f28c5875911c663541dd4fd1a48fecfe412e8bf Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Sun, 29 Aug 2021 02:19:58 +0200 Subject: [PATCH] Address Spaces: compiles() test cases --- test/cases.zig | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/cases.zig b/test/cases.zig index 1a92f20262..e36bb368c8 100644 --- a/test/cases.zig +++ b/test/cases.zig @@ -1831,6 +1831,20 @@ pub fn addCases(ctx: *TestContext) !void { ":2:12: error: expected *i32, found *addrspace(.gs) i32", }); + case.compiles( + \\fn entry(a: *addrspace(.gs) i32) *addrspace(.gs) i32 { + \\ return a; + \\} + \\pub fn main() void { _ = entry; } + ); + + case.compiles( + \\fn entry(a: *addrspace(.generic) i32) *i32 { + \\ return a; + \\} + \\pub fn main() void { _ = entry; } + ); + case.addError( \\fn entry(a: *addrspace(.gs) i32) *addrspace(.fs) i32 { \\ return a; @@ -1857,5 +1871,12 @@ pub fn addCases(ctx: *TestContext) !void { , &[_][]const u8{ ":2:12: error: expected *i32, found *addrspace(.gs) i32", }); + + case.compiles( + \\fn entry(a: *addrspace(.gs) i32) *addrspace(.gs) i32 { + \\ return &a.*; + \\} + \\pub fn main() void { _ = entry; } + ); } }