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 {
814814 \\}
815815 , &[_][]const u8{
816816 \\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);
818818 \\}
819819 });
820820
......@@ -1980,7 +1980,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
19801980 \\ var a = arg_a;
19811981 \\ var i: c_int = 0;
19821982 \\ 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);
19841984 \\ }
19851985 \\ return i;
19861986 \\}
......@@ -2000,7 +2000,7 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
20002000 \\ var a = arg_a;
20012001 \\ var i: c_int = 0;
20022002 \\ 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);
20042004 \\ }
20052005 \\ return i;
20062006 \\}
......@@ -2051,14 +2051,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
20512051 \\ ref.* = ref.* ^ @as(c_int, 1);
20522052 \\ break :blk ref.*;
20532053 \\ });
2054 \\ a >>= @as(@import("std").math.Log2Int(c_int), (blk: {
2054 \\ a >>= @intCast(@import("std").math.Log2Int(c_int), (blk: {
20552055 \\ 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));
20572057 \\ break :blk ref.*;
20582058 \\ }));
2059 \\ a <<= @as(@import("std").math.Log2Int(c_int), (blk: {
2059 \\ a <<= @intCast(@import("std").math.Log2Int(c_int), (blk: {
20602060 \\ 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));
20622062 \\ break :blk ref.*;
20632063 \\ }));
20642064 \\}
......@@ -2109,14 +2109,14 @@ pub fn addCases(cases: *tests.TranslateCContext) void {
21092109 \\ ref.* = ref.* ^ @bitCast(c_uint, @as(c_int, 1));
21102110 \\ break :blk ref.*;
21112111 \\ });
2112 \\ a >>= @as(@import("std").math.Log2Int(c_uint), (blk: {
2112 \\ a >>= @intCast(@import("std").math.Log2Int(c_uint), (blk: {
21132113 \\ 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));
21152115 \\ break :blk ref.*;
21162116 \\ }));
2117 \\ a <<= @as(@import("std").math.Log2Int(c_uint), (blk: {
2117 \\ a <<= @intCast(@import("std").math.Log2Int(c_uint), (blk: {
21182118 \\ 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));
21202120 \\ break :blk ref.*;
21212121 \\ }));
21222122 \\}