stage2: refactor handling of immediates in x86_64 backend
Fixes issues with incorrect operand sizes in a handful of cases and allows for usage of differently sized integers in Zig sources.
This commit is contained in:
@@ -1700,6 +1700,36 @@ pub fn addCases(ctx: *TestContext) !void {
|
||||
\\ if (!ok) unreachable;
|
||||
\\}
|
||||
, "");
|
||||
case.addCompareOutput(
|
||||
\\pub fn main() void {
|
||||
\\ var x: u16 = undefined;
|
||||
\\ set(&x);
|
||||
\\ assert(x == 123);
|
||||
\\}
|
||||
\\
|
||||
\\fn set(x: *u16) void {
|
||||
\\ x.* = 123;
|
||||
\\}
|
||||
\\
|
||||
\\fn assert(ok: bool) void {
|
||||
\\ if (!ok) unreachable;
|
||||
\\}
|
||||
, "");
|
||||
case.addCompareOutput(
|
||||
\\pub fn main() void {
|
||||
\\ var x: u8 = undefined;
|
||||
\\ set(&x);
|
||||
\\ assert(x == 123);
|
||||
\\}
|
||||
\\
|
||||
\\fn set(x: *u8) void {
|
||||
\\ x.* = 123;
|
||||
\\}
|
||||
\\
|
||||
\\fn assert(ok: bool) void {
|
||||
\\ if (!ok) unreachable;
|
||||
\\}
|
||||
, "");
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user