mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
Address Spaces: compiles() test cases
This commit is contained in:
parent
7686165c82
commit
8f28c58759
@ -1831,6 +1831,20 @@ pub fn addCases(ctx: *TestContext) !void {
|
|||||||
":2:12: error: expected *i32, found *addrspace(.gs) i32",
|
":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(
|
case.addError(
|
||||||
\\fn entry(a: *addrspace(.gs) i32) *addrspace(.fs) i32 {
|
\\fn entry(a: *addrspace(.gs) i32) *addrspace(.fs) i32 {
|
||||||
\\ return a;
|
\\ return a;
|
||||||
@ -1857,5 +1871,12 @@ pub fn addCases(ctx: *TestContext) !void {
|
|||||||
, &[_][]const u8{
|
, &[_][]const u8{
|
||||||
":2:12: error: expected *i32, found *addrspace(.gs) i32",
|
":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; }
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user