authorgravatar for thejoshwolfe@gmail.comJosh Wolfe <thejoshwolfe@gmail.com> 2020-01-03 20:55:47-07:00
committergravatar for thejoshwolfe@gmail.comJosh Wolfe <thejoshwolfe@gmail.com> 2020-01-03 20:55:47-07:00
logac867cc45f8e99297647bd29ddfa746462500b72
tree8c9095e6b391bead3e5edf84ba6751d5f243c4a1
parent7838031b436fa403c628af46f62c7eb914808fd7

fix tests


1 files changed, 11 insertions(+), 11 deletions(-)

test/translate_c.zig+11-11
...@@ -814,7 +814,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -814,7 +814,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
814 \\}814 \\}
815 , &[_][]const u8{815 , &[_][]const u8{
816 \\pub export fn foo() c_int {816 \\pub export fn foo() c_int {
817 \\ return (@as(c_int, 1) << @as(@import("std").math.Log2Int(c_int), 2)) >> @as(@import("std").math.Log2Int(c_int), 1);817 \\ return (@as(c_int, 1) << @intCast(@import("std").math.Log2Int(c_int), 2)) >> @intCast(@import("std").math.Log2Int(c_int), 1);
818 \\}818 \\}
819 });819 });
820820
...@@ -1980,7 +1980,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -1980,7 +1980,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
1980 \\ var a = arg_a;1980 \\ var a = arg_a;
1981 \\ var i: c_int = 0;1981 \\ var i: c_int = 0;
1982 \\ while (a > @bitCast(c_uint, @as(c_int, 0))) {1982 \\ while (a > @bitCast(c_uint, @as(c_int, 0))) {
1983 \\ a >>= @as(@import("std").math.Log2Int(c_int), 1);1983 \\ a >>= @intCast(@import("std").math.Log2Int(c_int), 1);
1984 \\ }1984 \\ }
1985 \\ return i;1985 \\ return i;
1986 \\}1986 \\}
...@@ -2000,7 +2000,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -2000,7 +2000,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
2000 \\ var a = arg_a;2000 \\ var a = arg_a;
2001 \\ var i: c_int = 0;2001 \\ var i: c_int = 0;
2002 \\ while (a > @bitCast(c_uint, @as(c_int, 0))) {2002 \\ while (a > @bitCast(c_uint, @as(c_int, 0))) {
2003 \\ a >>= @as(@import("std").math.Log2Int(c_int), 1);2003 \\ a >>= @intCast(@import("std").math.Log2Int(c_int), 1);
2004 \\ }2004 \\ }
2005 \\ return i;2005 \\ return i;
2006 \\}2006 \\}
...@@ -2051,14 +2051,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -2051,14 +2051,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
2051 \\ ref.* = ref.* ^ @as(c_int, 1);2051 \\ ref.* = ref.* ^ @as(c_int, 1);
2052 \\ break :blk ref.*;2052 \\ break :blk ref.*;
2053 \\ });2053 \\ });
2054 \\ a >>= @as(@import("std").math.Log2Int(c_int), (blk: {2054 \\ a >>= @intCast(@import("std").math.Log2Int(c_int), (blk: {
2055 \\ const ref = &a;2055 \\ const ref = &a;
2056 \\ ref.* = ref.* >> @as(@import("std").math.Log2Int(c_int), @as(c_int, 1));2056 \\ ref.* = ref.* >> @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1));
2057 \\ break :blk ref.*;2057 \\ break :blk ref.*;
2058 \\ }));2058 \\ }));
2059 \\ a <<= @as(@import("std").math.Log2Int(c_int), (blk: {2059 \\ a <<= @intCast(@import("std").math.Log2Int(c_int), (blk: {
2060 \\ const ref = &a;2060 \\ const ref = &a;
2061 \\ ref.* = ref.* << @as(@import("std").math.Log2Int(c_int), @as(c_int, 1));2061 \\ ref.* = ref.* << @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1));
2062 \\ break :blk ref.*;2062 \\ break :blk ref.*;
2063 \\ }));2063 \\ }));
2064 \\}2064 \\}
...@@ -2109,14 +2109,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void {...@@ -2109,14 +2109,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
2109 \\ ref.* = ref.* ^ @bitCast(c_uint, @as(c_int, 1));2109 \\ ref.* = ref.* ^ @bitCast(c_uint, @as(c_int, 1));
2110 \\ break :blk ref.*;2110 \\ break :blk ref.*;
2111 \\ });2111 \\ });
2112 \\ a >>= @as(@import("std").math.Log2Int(c_uint), (blk: {2112 \\ a >>= @intCast(@import("std").math.Log2Int(c_uint), (blk: {
2113 \\ const ref = &a;2113 \\ const ref = &a;
2114 \\ ref.* = ref.* >> @as(@import("std").math.Log2Int(c_int), @as(c_int, 1));2114 \\ ref.* = ref.* >> @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1));
2115 \\ break :blk ref.*;2115 \\ break :blk ref.*;
2116 \\ }));2116 \\ }));
2117 \\ a <<= @as(@import("std").math.Log2Int(c_uint), (blk: {2117 \\ a <<= @intCast(@import("std").math.Log2Int(c_uint), (blk: {
2118 \\ const ref = &a;2118 \\ const ref = &a;
2119 \\ ref.* = ref.* << @as(@import("std").math.Log2Int(c_int), @as(c_int, 1));2119 \\ ref.* = ref.* << @intCast(@import("std").math.Log2Int(c_int), @as(c_int, 1));
2120 \\ break :blk ref.*;2120 \\ break :blk ref.*;
2121 \\ }));2121 \\ }));
2122 \\}2122 \\}