authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-06-13 14:53:41-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2023-06-13 14:53:41-07:00
log38fc826a5a82bbe11a893be11d3cc1439c477ee8
treea6f1d07274887a20818b8e9f0798f1f74c318de5
parent700ea694b293565ececb7571e4d9613d2c143ca6
parentd884d7050e061c620324aaaabfba507e08cb40f4
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #15957 from BratishkaErik/deprecated-

std.*: remove stuff that was deprecated in older versions

83 files changed, 1091 insertions(+), 1045 deletions(-)

doc/langref.html.in+11-11
......@@ -3306,7 +3306,7 @@ const Divided = packed struct {
33063306
33073307test "@bitCast between packed structs" {
33083308 try doTheTest();
3309 comptime try doTheTest();
3309 try comptime doTheTest();
33103310}
33113311
33123312fn doTheTest() !void {
......@@ -5815,10 +5815,10 @@ test "error union" {
58155815 foo = error.SomeError;
58165816
58175817 // Use compile-time reflection to access the payload type of an error union:
5818 comptime try expect(@typeInfo(@TypeOf(foo)).ErrorUnion.payload == i32);
5818 try comptime expect(@typeInfo(@TypeOf(foo)).ErrorUnion.payload == i32);
58195819
58205820 // Use compile-time reflection to access the error set type of an error union:
5821 comptime try expect(@typeInfo(@TypeOf(foo)).ErrorUnion.error_set == anyerror);
5821 try comptime expect(@typeInfo(@TypeOf(foo)).ErrorUnion.error_set == anyerror);
58225822}
58235823 {#code_end#}
58245824 {#header_open|Merging Error Sets#}
......@@ -6199,7 +6199,7 @@ test "optional type" {
61996199 foo = 1234;
62006200
62016201 // Use compile-time reflection to access the child type of the optional:
6202 comptime try expect(@typeInfo(@TypeOf(foo)).Optional.child == i32);
6202 try comptime expect(@typeInfo(@TypeOf(foo)).Optional.child == i32);
62036203}
62046204 {#code_end#}
62056205 {#header_close#}
......@@ -6632,8 +6632,8 @@ test "peer resolve int widening" {
66326632test "peer resolve arrays of different size to const slice" {
66336633 try expect(mem.eql(u8, boolToStr(true), "true"));
66346634 try expect(mem.eql(u8, boolToStr(false), "false"));
6635 comptime try expect(mem.eql(u8, boolToStr(true), "true"));
6636 comptime try expect(mem.eql(u8, boolToStr(false), "false"));
6635 try comptime expect(mem.eql(u8, boolToStr(true), "true"));
6636 try comptime expect(mem.eql(u8, boolToStr(false), "false"));
66376637}
66386638fn boolToStr(b: bool) []const u8 {
66396639 return if (b) "true" else "false";
......@@ -6641,7 +6641,7 @@ fn boolToStr(b: bool) []const u8 {
66416641
66426642test "peer resolve array and const slice" {
66436643 try testPeerResolveArrayConstSlice(true);
6644 comptime try testPeerResolveArrayConstSlice(true);
6644 try comptime testPeerResolveArrayConstSlice(true);
66456645}
66466646fn testPeerResolveArrayConstSlice(b: bool) !void {
66476647 const value1 = if (b) "aoeu" else @as([]const u8, "zz");
......@@ -9184,7 +9184,7 @@ const expect = std.testing.expect;
91849184test "vector @splat" {
91859185 const scalar: u32 = 5;
91869186 const result = @splat(4, scalar);
9187 comptime try expect(@TypeOf(result) == @Vector(4, u32));
9187 try comptime expect(@TypeOf(result) == @Vector(4, u32));
91889188 try expect(std.mem.eql(u32, &@as([4]u32, result), &[_]u32{ 5, 5, 5, 5 }));
91899189}
91909190 {#code_end#}
......@@ -9228,9 +9228,9 @@ test "vector @reduce" {
92289228 const value = @Vector(4, i32){ 1, -1, 1, -1 };
92299229 const result = value > @splat(4, @as(i32, 0));
92309230 // result is { true, false, true, false };
9231 comptime try expect(@TypeOf(result) == @Vector(4, bool));
9231 try comptime expect(@TypeOf(result) == @Vector(4, bool));
92329232 const is_all_true = @reduce(.And, result);
9233 comptime try expect(@TypeOf(is_all_true) == bool);
9233 try comptime expect(@TypeOf(is_all_true) == bool);
92349234 try expect(is_all_true == false);
92359235}
92369236 {#code_end#}
......@@ -9571,7 +9571,7 @@ const expect = std.testing.expect;
95719571test "no runtime side effects" {
95729572 var data: i32 = 0;
95739573 const T = @TypeOf(foo(i32, &data));
9574 comptime try expect(T == i32);
9574 try comptime expect(T == i32);
95759575 try expect(data == 0);
95769576}
95779577
lib/compiler_rt/powiXf2_test.zig+235-230
......@@ -32,17 +32,18 @@ fn test__powixf2(a: f80, b: i32, expected: f80) !void {
3232}
3333
3434test "powihf2" {
35 const inf_f16 = math.inf(f16);
3536 try test__powisf2(0, 0, 1);
3637 try test__powihf2(1, 0, 1);
3738 try test__powihf2(1.5, 0, 1);
3839 try test__powihf2(2, 0, 1);
39 try test__powihf2(math.inf_f16, 0, 1);
40 try test__powihf2(inf_f16, 0, 1);
4041
4142 try test__powihf2(-0.0, 0, 1);
4243 try test__powihf2(-1, 0, 1);
4344 try test__powihf2(-1.5, 0, 1);
4445 try test__powihf2(-2, 0, 1);
45 try test__powihf2(-math.inf_f16, 0, 1);
46 try test__powihf2(-inf_f16, 0, 1);
4647
4748 try test__powihf2(0, 1, 0);
4849 try test__powihf2(0, 2, 0);
......@@ -65,35 +66,35 @@ test "powihf2" {
6566 try test__powihf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFE)), 1);
6667 try test__powihf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFF)), 1);
6768
68 try test__powihf2(math.inf_f16, 1, math.inf_f16);
69 try test__powihf2(math.inf_f16, 2, math.inf_f16);
70 try test__powihf2(math.inf_f16, 3, math.inf_f16);
71 try test__powihf2(math.inf_f16, 4, math.inf_f16);
72 try test__powihf2(math.inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f16);
73 try test__powihf2(math.inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFF)), math.inf_f16);
74
75 try test__powihf2(-math.inf_f16, 1, -math.inf_f16);
76 try test__powihf2(-math.inf_f16, 2, math.inf_f16);
77 try test__powihf2(-math.inf_f16, 3, -math.inf_f16);
78 try test__powihf2(-math.inf_f16, 4, math.inf_f16);
79 try test__powihf2(-math.inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f16);
80 try test__powihf2(-math.inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -math.inf_f16);
69 try test__powihf2(inf_f16, 1, inf_f16);
70 try test__powihf2(inf_f16, 2, inf_f16);
71 try test__powihf2(inf_f16, 3, inf_f16);
72 try test__powihf2(inf_f16, 4, inf_f16);
73 try test__powihf2(inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f16);
74 try test__powihf2(inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFF)), inf_f16);
75
76 try test__powihf2(-inf_f16, 1, -inf_f16);
77 try test__powihf2(-inf_f16, 2, inf_f16);
78 try test__powihf2(-inf_f16, 3, -inf_f16);
79 try test__powihf2(-inf_f16, 4, inf_f16);
80 try test__powihf2(-inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f16);
81 try test__powihf2(-inf_f16, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -inf_f16);
8182 //
82 try test__powihf2(0, -1, math.inf_f16);
83 try test__powihf2(0, -2, math.inf_f16);
84 try test__powihf2(0, -3, math.inf_f16);
85 try test__powihf2(0, -4, math.inf_f16);
86 try test__powihf2(0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f16); // 0 ^ anything = +inf
87 try test__powihf2(0, @bitCast(i32, @as(u32, 0x80000001)), math.inf_f16);
88 try test__powihf2(0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f16);
89
90 try test__powihf2(-0.0, -1, -math.inf_f16);
91 try test__powihf2(-0.0, -2, math.inf_f16);
92 try test__powihf2(-0.0, -3, -math.inf_f16);
93 try test__powihf2(-0.0, -4, math.inf_f16);
94 try test__powihf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f16); // -0 ^ anything even = +inf
95 try test__powihf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -math.inf_f16); // -0 ^ anything odd = -inf
96 try test__powihf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f16);
83 try test__powihf2(0, -1, inf_f16);
84 try test__powihf2(0, -2, inf_f16);
85 try test__powihf2(0, -3, inf_f16);
86 try test__powihf2(0, -4, inf_f16);
87 try test__powihf2(0, @bitCast(i32, @as(u32, 0x80000002)), inf_f16); // 0 ^ anything = +inf
88 try test__powihf2(0, @bitCast(i32, @as(u32, 0x80000001)), inf_f16);
89 try test__powihf2(0, @bitCast(i32, @as(u32, 0x80000000)), inf_f16);
90
91 try test__powihf2(-0.0, -1, -inf_f16);
92 try test__powihf2(-0.0, -2, inf_f16);
93 try test__powihf2(-0.0, -3, -inf_f16);
94 try test__powihf2(-0.0, -4, inf_f16);
95 try test__powihf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), inf_f16); // -0 ^ anything even = +inf
96 try test__powihf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -inf_f16); // -0 ^ anything odd = -inf
97 try test__powihf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), inf_f16);
9798
9899 try test__powihf2(1, -1, 1);
99100 try test__powihf2(1, -2, 1);
......@@ -103,21 +104,21 @@ test "powihf2" {
103104 try test__powihf2(1, @bitCast(i32, @as(u32, 0x80000001)), 1);
104105 try test__powihf2(1, @bitCast(i32, @as(u32, 0x80000000)), 1);
105106
106 try test__powihf2(math.inf_f16, -1, 0);
107 try test__powihf2(math.inf_f16, -2, 0);
108 try test__powihf2(math.inf_f16, -3, 0);
109 try test__powihf2(math.inf_f16, -4, 0);
110 try test__powihf2(math.inf_f16, @bitCast(i32, @as(u32, 0x80000002)), 0);
111 try test__powihf2(math.inf_f16, @bitCast(i32, @as(u32, 0x80000001)), 0);
112 try test__powihf2(math.inf_f16, @bitCast(i32, @as(u32, 0x80000000)), 0);
107 try test__powihf2(inf_f16, -1, 0);
108 try test__powihf2(inf_f16, -2, 0);
109 try test__powihf2(inf_f16, -3, 0);
110 try test__powihf2(inf_f16, -4, 0);
111 try test__powihf2(inf_f16, @bitCast(i32, @as(u32, 0x80000002)), 0);
112 try test__powihf2(inf_f16, @bitCast(i32, @as(u32, 0x80000001)), 0);
113 try test__powihf2(inf_f16, @bitCast(i32, @as(u32, 0x80000000)), 0);
113114 //
114 try test__powihf2(-math.inf_f16, -1, -0.0);
115 try test__powihf2(-math.inf_f16, -2, 0);
116 try test__powihf2(-math.inf_f16, -3, -0.0);
117 try test__powihf2(-math.inf_f16, -4, 0);
118 try test__powihf2(-math.inf_f16, @bitCast(i32, @as(u32, 0x80000002)), 0);
119 try test__powihf2(-math.inf_f16, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
120 try test__powihf2(-math.inf_f16, @bitCast(i32, @as(u32, 0x80000000)), 0);
115 try test__powihf2(-inf_f16, -1, -0.0);
116 try test__powihf2(-inf_f16, -2, 0);
117 try test__powihf2(-inf_f16, -3, -0.0);
118 try test__powihf2(-inf_f16, -4, 0);
119 try test__powihf2(-inf_f16, @bitCast(i32, @as(u32, 0x80000002)), 0);
120 try test__powihf2(-inf_f16, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
121 try test__powihf2(-inf_f16, @bitCast(i32, @as(u32, 0x80000000)), 0);
121122
122123 try test__powihf2(2, 10, 1024.0);
123124 try test__powihf2(-2, 10, 1024.0);
......@@ -128,8 +129,8 @@ test "powihf2" {
128129 try test__powihf2(-2, 14, 16384.0);
129130 try test__powihf2(2, 15, 32768.0);
130131 try test__powihf2(-2, 15, -32768.0);
131 try test__powihf2(2, 16, math.inf_f16);
132 try test__powihf2(-2, 16, math.inf_f16);
132 try test__powihf2(2, 16, inf_f16);
133 try test__powihf2(-2, 16, inf_f16);
133134
134135 try test__powihf2(2, -13, 1.0 / 8192.0);
135136 try test__powihf2(-2, -13, -1.0 / 8192.0);
......@@ -140,17 +141,18 @@ test "powihf2" {
140141}
141142
142143test "powisf2" {
144 const inf_f32 = math.inf(f32);
143145 try test__powisf2(0, 0, 1);
144146 try test__powisf2(1, 0, 1);
145147 try test__powisf2(1.5, 0, 1);
146148 try test__powisf2(2, 0, 1);
147 try test__powisf2(math.inf_f32, 0, 1);
149 try test__powisf2(inf_f32, 0, 1);
148150
149151 try test__powisf2(-0.0, 0, 1);
150152 try test__powisf2(-1, 0, 1);
151153 try test__powisf2(-1.5, 0, 1);
152154 try test__powisf2(-2, 0, 1);
153 try test__powisf2(-math.inf_f32, 0, 1);
155 try test__powisf2(-inf_f32, 0, 1);
154156
155157 try test__powisf2(0, 1, 0);
156158 try test__powisf2(0, 2, 0);
......@@ -173,35 +175,35 @@ test "powisf2" {
173175 try test__powisf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFE)), 1);
174176 try test__powisf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFF)), 1);
175177
176 try test__powisf2(math.inf_f32, 1, math.inf_f32);
177 try test__powisf2(math.inf_f32, 2, math.inf_f32);
178 try test__powisf2(math.inf_f32, 3, math.inf_f32);
179 try test__powisf2(math.inf_f32, 4, math.inf_f32);
180 try test__powisf2(math.inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f32);
181 try test__powisf2(math.inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFF)), math.inf_f32);
182
183 try test__powisf2(-math.inf_f32, 1, -math.inf_f32);
184 try test__powisf2(-math.inf_f32, 2, math.inf_f32);
185 try test__powisf2(-math.inf_f32, 3, -math.inf_f32);
186 try test__powisf2(-math.inf_f32, 4, math.inf_f32);
187 try test__powisf2(-math.inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f32);
188 try test__powisf2(-math.inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -math.inf_f32);
189
190 try test__powisf2(0, -1, math.inf_f32);
191 try test__powisf2(0, -2, math.inf_f32);
192 try test__powisf2(0, -3, math.inf_f32);
193 try test__powisf2(0, -4, math.inf_f32);
194 try test__powisf2(0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f32);
195 try test__powisf2(0, @bitCast(i32, @as(u32, 0x80000001)), math.inf_f32);
196 try test__powisf2(0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f32);
197
198 try test__powisf2(-0.0, -1, -math.inf_f32);
199 try test__powisf2(-0.0, -2, math.inf_f32);
200 try test__powisf2(-0.0, -3, -math.inf_f32);
201 try test__powisf2(-0.0, -4, math.inf_f32);
202 try test__powisf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f32);
203 try test__powisf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -math.inf_f32);
204 try test__powisf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f32);
178 try test__powisf2(inf_f32, 1, inf_f32);
179 try test__powisf2(inf_f32, 2, inf_f32);
180 try test__powisf2(inf_f32, 3, inf_f32);
181 try test__powisf2(inf_f32, 4, inf_f32);
182 try test__powisf2(inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f32);
183 try test__powisf2(inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFF)), inf_f32);
184
185 try test__powisf2(-inf_f32, 1, -inf_f32);
186 try test__powisf2(-inf_f32, 2, inf_f32);
187 try test__powisf2(-inf_f32, 3, -inf_f32);
188 try test__powisf2(-inf_f32, 4, inf_f32);
189 try test__powisf2(-inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f32);
190 try test__powisf2(-inf_f32, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -inf_f32);
191
192 try test__powisf2(0, -1, inf_f32);
193 try test__powisf2(0, -2, inf_f32);
194 try test__powisf2(0, -3, inf_f32);
195 try test__powisf2(0, -4, inf_f32);
196 try test__powisf2(0, @bitCast(i32, @as(u32, 0x80000002)), inf_f32);
197 try test__powisf2(0, @bitCast(i32, @as(u32, 0x80000001)), inf_f32);
198 try test__powisf2(0, @bitCast(i32, @as(u32, 0x80000000)), inf_f32);
199
200 try test__powisf2(-0.0, -1, -inf_f32);
201 try test__powisf2(-0.0, -2, inf_f32);
202 try test__powisf2(-0.0, -3, -inf_f32);
203 try test__powisf2(-0.0, -4, inf_f32);
204 try test__powisf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), inf_f32);
205 try test__powisf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -inf_f32);
206 try test__powisf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), inf_f32);
205207
206208 try test__powisf2(1, -1, 1);
207209 try test__powisf2(1, -2, 1);
......@@ -211,21 +213,21 @@ test "powisf2" {
211213 try test__powisf2(1, @bitCast(i32, @as(u32, 0x80000001)), 1);
212214 try test__powisf2(1, @bitCast(i32, @as(u32, 0x80000000)), 1);
213215
214 try test__powisf2(math.inf_f32, -1, 0);
215 try test__powisf2(math.inf_f32, -2, 0);
216 try test__powisf2(math.inf_f32, -3, 0);
217 try test__powisf2(math.inf_f32, -4, 0);
218 try test__powisf2(math.inf_f32, @bitCast(i32, @as(u32, 0x80000002)), 0);
219 try test__powisf2(math.inf_f32, @bitCast(i32, @as(u32, 0x80000001)), 0);
220 try test__powisf2(math.inf_f32, @bitCast(i32, @as(u32, 0x80000000)), 0);
221
222 try test__powisf2(-math.inf_f32, -1, -0.0);
223 try test__powisf2(-math.inf_f32, -2, 0);
224 try test__powisf2(-math.inf_f32, -3, -0.0);
225 try test__powisf2(-math.inf_f32, -4, 0);
226 try test__powisf2(-math.inf_f32, @bitCast(i32, @as(u32, 0x80000002)), 0);
227 try test__powisf2(-math.inf_f32, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
228 try test__powisf2(-math.inf_f32, @bitCast(i32, @as(u32, 0x80000000)), 0);
216 try test__powisf2(inf_f32, -1, 0);
217 try test__powisf2(inf_f32, -2, 0);
218 try test__powisf2(inf_f32, -3, 0);
219 try test__powisf2(inf_f32, -4, 0);
220 try test__powisf2(inf_f32, @bitCast(i32, @as(u32, 0x80000002)), 0);
221 try test__powisf2(inf_f32, @bitCast(i32, @as(u32, 0x80000001)), 0);
222 try test__powisf2(inf_f32, @bitCast(i32, @as(u32, 0x80000000)), 0);
223
224 try test__powisf2(-inf_f32, -1, -0.0);
225 try test__powisf2(-inf_f32, -2, 0);
226 try test__powisf2(-inf_f32, -3, -0.0);
227 try test__powisf2(-inf_f32, -4, 0);
228 try test__powisf2(-inf_f32, @bitCast(i32, @as(u32, 0x80000002)), 0);
229 try test__powisf2(-inf_f32, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
230 try test__powisf2(-inf_f32, @bitCast(i32, @as(u32, 0x80000000)), 0);
229231
230232 try test__powisf2(2.0, 10, 1024.0);
231233 try test__powisf2(-2, 10, 1024.0);
......@@ -244,17 +246,18 @@ test "powisf2" {
244246}
245247
246248test "powidf2" {
249 const inf_f64 = math.inf(f64);
247250 try test__powidf2(0, 0, 1);
248251 try test__powidf2(1, 0, 1);
249252 try test__powidf2(1.5, 0, 1);
250253 try test__powidf2(2, 0, 1);
251 try test__powidf2(math.inf_f64, 0, 1);
254 try test__powidf2(inf_f64, 0, 1);
252255
253256 try test__powidf2(-0.0, 0, 1);
254257 try test__powidf2(-1, 0, 1);
255258 try test__powidf2(-1.5, 0, 1);
256259 try test__powidf2(-2, 0, 1);
257 try test__powidf2(-math.inf_f64, 0, 1);
260 try test__powidf2(-inf_f64, 0, 1);
258261
259262 try test__powidf2(0, 1, 0);
260263 try test__powidf2(0, 2, 0);
......@@ -277,35 +280,35 @@ test "powidf2" {
277280 try test__powidf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFE)), 1);
278281 try test__powidf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFF)), 1);
279282
280 try test__powidf2(math.inf_f64, 1, math.inf_f64);
281 try test__powidf2(math.inf_f64, 2, math.inf_f64);
282 try test__powidf2(math.inf_f64, 3, math.inf_f64);
283 try test__powidf2(math.inf_f64, 4, math.inf_f64);
284 try test__powidf2(math.inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f64);
285 try test__powidf2(math.inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFF)), math.inf_f64);
286
287 try test__powidf2(-math.inf_f64, 1, -math.inf_f64);
288 try test__powidf2(-math.inf_f64, 2, math.inf_f64);
289 try test__powidf2(-math.inf_f64, 3, -math.inf_f64);
290 try test__powidf2(-math.inf_f64, 4, math.inf_f64);
291 try test__powidf2(-math.inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f64);
292 try test__powidf2(-math.inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -math.inf_f64);
293
294 try test__powidf2(0, -1, math.inf_f64);
295 try test__powidf2(0, -2, math.inf_f64);
296 try test__powidf2(0, -3, math.inf_f64);
297 try test__powidf2(0, -4, math.inf_f64);
298 try test__powidf2(0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f64);
299 try test__powidf2(0, @bitCast(i32, @as(u32, 0x80000001)), math.inf_f64);
300 try test__powidf2(0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f64);
301
302 try test__powidf2(-0.0, -1, -math.inf_f64);
303 try test__powidf2(-0.0, -2, math.inf_f64);
304 try test__powidf2(-0.0, -3, -math.inf_f64);
305 try test__powidf2(-0.0, -4, math.inf_f64);
306 try test__powidf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f64);
307 try test__powidf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -math.inf_f64);
308 try test__powidf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f64);
283 try test__powidf2(inf_f64, 1, inf_f64);
284 try test__powidf2(inf_f64, 2, inf_f64);
285 try test__powidf2(inf_f64, 3, inf_f64);
286 try test__powidf2(inf_f64, 4, inf_f64);
287 try test__powidf2(inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f64);
288 try test__powidf2(inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFF)), inf_f64);
289
290 try test__powidf2(-inf_f64, 1, -inf_f64);
291 try test__powidf2(-inf_f64, 2, inf_f64);
292 try test__powidf2(-inf_f64, 3, -inf_f64);
293 try test__powidf2(-inf_f64, 4, inf_f64);
294 try test__powidf2(-inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f64);
295 try test__powidf2(-inf_f64, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -inf_f64);
296
297 try test__powidf2(0, -1, inf_f64);
298 try test__powidf2(0, -2, inf_f64);
299 try test__powidf2(0, -3, inf_f64);
300 try test__powidf2(0, -4, inf_f64);
301 try test__powidf2(0, @bitCast(i32, @as(u32, 0x80000002)), inf_f64);
302 try test__powidf2(0, @bitCast(i32, @as(u32, 0x80000001)), inf_f64);
303 try test__powidf2(0, @bitCast(i32, @as(u32, 0x80000000)), inf_f64);
304
305 try test__powidf2(-0.0, -1, -inf_f64);
306 try test__powidf2(-0.0, -2, inf_f64);
307 try test__powidf2(-0.0, -3, -inf_f64);
308 try test__powidf2(-0.0, -4, inf_f64);
309 try test__powidf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), inf_f64);
310 try test__powidf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -inf_f64);
311 try test__powidf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), inf_f64);
309312
310313 try test__powidf2(1, -1, 1);
311314 try test__powidf2(1, -2, 1);
......@@ -315,21 +318,21 @@ test "powidf2" {
315318 try test__powidf2(1, @bitCast(i32, @as(u32, 0x80000001)), 1);
316319 try test__powidf2(1, @bitCast(i32, @as(u32, 0x80000000)), 1);
317320
318 try test__powidf2(math.inf_f64, -1, 0);
319 try test__powidf2(math.inf_f64, -2, 0);
320 try test__powidf2(math.inf_f64, -3, 0);
321 try test__powidf2(math.inf_f64, -4, 0);
322 try test__powidf2(math.inf_f64, @bitCast(i32, @as(u32, 0x80000002)), 0);
323 try test__powidf2(math.inf_f64, @bitCast(i32, @as(u32, 0x80000001)), 0);
324 try test__powidf2(math.inf_f64, @bitCast(i32, @as(u32, 0x80000000)), 0);
325
326 try test__powidf2(-math.inf_f64, -1, -0.0);
327 try test__powidf2(-math.inf_f64, -2, 0);
328 try test__powidf2(-math.inf_f64, -3, -0.0);
329 try test__powidf2(-math.inf_f64, -4, 0);
330 try test__powidf2(-math.inf_f64, @bitCast(i32, @as(u32, 0x80000002)), 0);
331 try test__powidf2(-math.inf_f64, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
332 try test__powidf2(-math.inf_f64, @bitCast(i32, @as(u32, 0x80000000)), 0);
321 try test__powidf2(inf_f64, -1, 0);
322 try test__powidf2(inf_f64, -2, 0);
323 try test__powidf2(inf_f64, -3, 0);
324 try test__powidf2(inf_f64, -4, 0);
325 try test__powidf2(inf_f64, @bitCast(i32, @as(u32, 0x80000002)), 0);
326 try test__powidf2(inf_f64, @bitCast(i32, @as(u32, 0x80000001)), 0);
327 try test__powidf2(inf_f64, @bitCast(i32, @as(u32, 0x80000000)), 0);
328
329 try test__powidf2(-inf_f64, -1, -0.0);
330 try test__powidf2(-inf_f64, -2, 0);
331 try test__powidf2(-inf_f64, -3, -0.0);
332 try test__powidf2(-inf_f64, -4, 0);
333 try test__powidf2(-inf_f64, @bitCast(i32, @as(u32, 0x80000002)), 0);
334 try test__powidf2(-inf_f64, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
335 try test__powidf2(-inf_f64, @bitCast(i32, @as(u32, 0x80000000)), 0);
333336
334337 try test__powidf2(2, 10, 1024.0);
335338 try test__powidf2(-2, 10, 1024.0);
......@@ -348,17 +351,18 @@ test "powidf2" {
348351}
349352
350353test "powitf2" {
354 const inf_f128 = math.inf(f128);
351355 try test__powitf2(0, 0, 1);
352356 try test__powitf2(1, 0, 1);
353357 try test__powitf2(1.5, 0, 1);
354358 try test__powitf2(2, 0, 1);
355 try test__powitf2(math.inf_f128, 0, 1);
359 try test__powitf2(inf_f128, 0, 1);
356360
357361 try test__powitf2(-0.0, 0, 1);
358362 try test__powitf2(-1, 0, 1);
359363 try test__powitf2(-1.5, 0, 1);
360364 try test__powitf2(-2, 0, 1);
361 try test__powitf2(-math.inf_f128, 0, 1);
365 try test__powitf2(-inf_f128, 0, 1);
362366
363367 try test__powitf2(0, 1, 0);
364368 try test__powitf2(0, 2, 0);
......@@ -381,35 +385,35 @@ test "powitf2" {
381385 try test__powitf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFE)), 1);
382386 try test__powitf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFF)), 1);
383387
384 try test__powitf2(math.inf_f128, 1, math.inf_f128);
385 try test__powitf2(math.inf_f128, 2, math.inf_f128);
386 try test__powitf2(math.inf_f128, 3, math.inf_f128);
387 try test__powitf2(math.inf_f128, 4, math.inf_f128);
388 try test__powitf2(math.inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f128);
389 try test__powitf2(math.inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFF)), math.inf_f128);
390
391 try test__powitf2(-math.inf_f128, 1, -math.inf_f128);
392 try test__powitf2(-math.inf_f128, 2, math.inf_f128);
393 try test__powitf2(-math.inf_f128, 3, -math.inf_f128);
394 try test__powitf2(-math.inf_f128, 4, math.inf_f128);
395 try test__powitf2(-math.inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f128);
396 try test__powitf2(-math.inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -math.inf_f128);
397
398 try test__powitf2(0, -1, math.inf_f128);
399 try test__powitf2(0, -2, math.inf_f128);
400 try test__powitf2(0, -3, math.inf_f128);
401 try test__powitf2(0, -4, math.inf_f128);
402 try test__powitf2(0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f128);
403 try test__powitf2(0, @bitCast(i32, @as(u32, 0x80000001)), math.inf_f128);
404 try test__powitf2(0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f128);
405
406 try test__powitf2(-0.0, -1, -math.inf_f128);
407 try test__powitf2(-0.0, -2, math.inf_f128);
408 try test__powitf2(-0.0, -3, -math.inf_f128);
409 try test__powitf2(-0.0, -4, math.inf_f128);
410 try test__powitf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f128);
411 try test__powitf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -math.inf_f128);
412 try test__powitf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f128);
388 try test__powitf2(inf_f128, 1, inf_f128);
389 try test__powitf2(inf_f128, 2, inf_f128);
390 try test__powitf2(inf_f128, 3, inf_f128);
391 try test__powitf2(inf_f128, 4, inf_f128);
392 try test__powitf2(inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f128);
393 try test__powitf2(inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFF)), inf_f128);
394
395 try test__powitf2(-inf_f128, 1, -inf_f128);
396 try test__powitf2(-inf_f128, 2, inf_f128);
397 try test__powitf2(-inf_f128, 3, -inf_f128);
398 try test__powitf2(-inf_f128, 4, inf_f128);
399 try test__powitf2(-inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f128);
400 try test__powitf2(-inf_f128, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -inf_f128);
401
402 try test__powitf2(0, -1, inf_f128);
403 try test__powitf2(0, -2, inf_f128);
404 try test__powitf2(0, -3, inf_f128);
405 try test__powitf2(0, -4, inf_f128);
406 try test__powitf2(0, @bitCast(i32, @as(u32, 0x80000002)), inf_f128);
407 try test__powitf2(0, @bitCast(i32, @as(u32, 0x80000001)), inf_f128);
408 try test__powitf2(0, @bitCast(i32, @as(u32, 0x80000000)), inf_f128);
409
410 try test__powitf2(-0.0, -1, -inf_f128);
411 try test__powitf2(-0.0, -2, inf_f128);
412 try test__powitf2(-0.0, -3, -inf_f128);
413 try test__powitf2(-0.0, -4, inf_f128);
414 try test__powitf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), inf_f128);
415 try test__powitf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -inf_f128);
416 try test__powitf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), inf_f128);
413417
414418 try test__powitf2(1, -1, 1);
415419 try test__powitf2(1, -2, 1);
......@@ -419,21 +423,21 @@ test "powitf2" {
419423 try test__powitf2(1, @bitCast(i32, @as(u32, 0x80000001)), 1);
420424 try test__powitf2(1, @bitCast(i32, @as(u32, 0x80000000)), 1);
421425
422 try test__powitf2(math.inf_f128, -1, 0);
423 try test__powitf2(math.inf_f128, -2, 0);
424 try test__powitf2(math.inf_f128, -3, 0);
425 try test__powitf2(math.inf_f128, -4, 0);
426 try test__powitf2(math.inf_f128, @bitCast(i32, @as(u32, 0x80000002)), 0);
427 try test__powitf2(math.inf_f128, @bitCast(i32, @as(u32, 0x80000001)), 0);
428 try test__powitf2(math.inf_f128, @bitCast(i32, @as(u32, 0x80000000)), 0);
429
430 try test__powitf2(-math.inf_f128, -1, -0.0);
431 try test__powitf2(-math.inf_f128, -2, 0);
432 try test__powitf2(-math.inf_f128, -3, -0.0);
433 try test__powitf2(-math.inf_f128, -4, 0);
434 try test__powitf2(-math.inf_f128, @bitCast(i32, @as(u32, 0x80000002)), 0);
435 try test__powitf2(-math.inf_f128, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
436 try test__powitf2(-math.inf_f128, @bitCast(i32, @as(u32, 0x80000000)), 0);
426 try test__powitf2(inf_f128, -1, 0);
427 try test__powitf2(inf_f128, -2, 0);
428 try test__powitf2(inf_f128, -3, 0);
429 try test__powitf2(inf_f128, -4, 0);
430 try test__powitf2(inf_f128, @bitCast(i32, @as(u32, 0x80000002)), 0);
431 try test__powitf2(inf_f128, @bitCast(i32, @as(u32, 0x80000001)), 0);
432 try test__powitf2(inf_f128, @bitCast(i32, @as(u32, 0x80000000)), 0);
433
434 try test__powitf2(-inf_f128, -1, -0.0);
435 try test__powitf2(-inf_f128, -2, 0);
436 try test__powitf2(-inf_f128, -3, -0.0);
437 try test__powitf2(-inf_f128, -4, 0);
438 try test__powitf2(-inf_f128, @bitCast(i32, @as(u32, 0x80000002)), 0);
439 try test__powitf2(-inf_f128, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
440 try test__powitf2(-inf_f128, @bitCast(i32, @as(u32, 0x80000000)), 0);
437441
438442 try test__powitf2(2, 10, 1024.0);
439443 try test__powitf2(-2, 10, 1024.0);
......@@ -452,17 +456,18 @@ test "powitf2" {
452456}
453457
454458test "powixf2" {
459 const inf_f80 = math.inf(f80);
455460 try test__powixf2(0, 0, 1);
456461 try test__powixf2(1, 0, 1);
457462 try test__powixf2(1.5, 0, 1);
458463 try test__powixf2(2, 0, 1);
459 try test__powixf2(math.inf_f80, 0, 1);
464 try test__powixf2(inf_f80, 0, 1);
460465
461466 try test__powixf2(-0.0, 0, 1);
462467 try test__powixf2(-1, 0, 1);
463468 try test__powixf2(-1.5, 0, 1);
464469 try test__powixf2(-2, 0, 1);
465 try test__powixf2(-math.inf_f80, 0, 1);
470 try test__powixf2(-inf_f80, 0, 1);
466471
467472 try test__powixf2(0, 1, 0);
468473 try test__powixf2(0, 2, 0);
......@@ -485,35 +490,35 @@ test "powixf2" {
485490 try test__powixf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFE)), 1);
486491 try test__powixf2(1, @bitCast(i32, @as(u32, 0x7FFFFFFF)), 1);
487492
488 try test__powixf2(math.inf_f80, 1, math.inf_f80);
489 try test__powixf2(math.inf_f80, 2, math.inf_f80);
490 try test__powixf2(math.inf_f80, 3, math.inf_f80);
491 try test__powixf2(math.inf_f80, 4, math.inf_f80);
492 try test__powixf2(math.inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f80);
493 try test__powixf2(math.inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFF)), math.inf_f80);
494
495 try test__powixf2(-math.inf_f80, 1, -math.inf_f80);
496 try test__powixf2(-math.inf_f80, 2, math.inf_f80);
497 try test__powixf2(-math.inf_f80, 3, -math.inf_f80);
498 try test__powixf2(-math.inf_f80, 4, math.inf_f80);
499 try test__powixf2(-math.inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFE)), math.inf_f80);
500 try test__powixf2(-math.inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -math.inf_f80);
501
502 try test__powixf2(0, -1, math.inf_f80);
503 try test__powixf2(0, -2, math.inf_f80);
504 try test__powixf2(0, -3, math.inf_f80);
505 try test__powixf2(0, -4, math.inf_f80);
506 try test__powixf2(0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f80);
507 try test__powixf2(0, @bitCast(i32, @as(u32, 0x80000001)), math.inf_f80);
508 try test__powixf2(0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f80);
509
510 try test__powixf2(-0.0, -1, -math.inf_f80);
511 try test__powixf2(-0.0, -2, math.inf_f80);
512 try test__powixf2(-0.0, -3, -math.inf_f80);
513 try test__powixf2(-0.0, -4, math.inf_f80);
514 try test__powixf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), math.inf_f80);
515 try test__powixf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -math.inf_f80);
516 try test__powixf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), math.inf_f80);
493 try test__powixf2(inf_f80, 1, inf_f80);
494 try test__powixf2(inf_f80, 2, inf_f80);
495 try test__powixf2(inf_f80, 3, inf_f80);
496 try test__powixf2(inf_f80, 4, inf_f80);
497 try test__powixf2(inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f80);
498 try test__powixf2(inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFF)), inf_f80);
499
500 try test__powixf2(-inf_f80, 1, -inf_f80);
501 try test__powixf2(-inf_f80, 2, inf_f80);
502 try test__powixf2(-inf_f80, 3, -inf_f80);
503 try test__powixf2(-inf_f80, 4, inf_f80);
504 try test__powixf2(-inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFE)), inf_f80);
505 try test__powixf2(-inf_f80, @bitCast(i32, @as(u32, 0x7FFFFFFF)), -inf_f80);
506
507 try test__powixf2(0, -1, inf_f80);
508 try test__powixf2(0, -2, inf_f80);
509 try test__powixf2(0, -3, inf_f80);
510 try test__powixf2(0, -4, inf_f80);
511 try test__powixf2(0, @bitCast(i32, @as(u32, 0x80000002)), inf_f80);
512 try test__powixf2(0, @bitCast(i32, @as(u32, 0x80000001)), inf_f80);
513 try test__powixf2(0, @bitCast(i32, @as(u32, 0x80000000)), inf_f80);
514
515 try test__powixf2(-0.0, -1, -inf_f80);
516 try test__powixf2(-0.0, -2, inf_f80);
517 try test__powixf2(-0.0, -3, -inf_f80);
518 try test__powixf2(-0.0, -4, inf_f80);
519 try test__powixf2(-0.0, @bitCast(i32, @as(u32, 0x80000002)), inf_f80);
520 try test__powixf2(-0.0, @bitCast(i32, @as(u32, 0x80000001)), -inf_f80);
521 try test__powixf2(-0.0, @bitCast(i32, @as(u32, 0x80000000)), inf_f80);
517522
518523 try test__powixf2(1, -1, 1);
519524 try test__powixf2(1, -2, 1);
......@@ -523,21 +528,21 @@ test "powixf2" {
523528 try test__powixf2(1, @bitCast(i32, @as(u32, 0x80000001)), 1);
524529 try test__powixf2(1, @bitCast(i32, @as(u32, 0x80000000)), 1);
525530
526 try test__powixf2(math.inf_f80, -1, 0);
527 try test__powixf2(math.inf_f80, -2, 0);
528 try test__powixf2(math.inf_f80, -3, 0);
529 try test__powixf2(math.inf_f80, -4, 0);
530 try test__powixf2(math.inf_f80, @bitCast(i32, @as(u32, 0x80000002)), 0);
531 try test__powixf2(math.inf_f80, @bitCast(i32, @as(u32, 0x80000001)), 0);
532 try test__powixf2(math.inf_f80, @bitCast(i32, @as(u32, 0x80000000)), 0);
533
534 try test__powixf2(-math.inf_f80, -1, -0.0);
535 try test__powixf2(-math.inf_f80, -2, 0);
536 try test__powixf2(-math.inf_f80, -3, -0.0);
537 try test__powixf2(-math.inf_f80, -4, 0);
538 try test__powixf2(-math.inf_f80, @bitCast(i32, @as(u32, 0x80000002)), 0);
539 try test__powixf2(-math.inf_f80, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
540 try test__powixf2(-math.inf_f80, @bitCast(i32, @as(u32, 0x80000000)), 0);
531 try test__powixf2(inf_f80, -1, 0);
532 try test__powixf2(inf_f80, -2, 0);
533 try test__powixf2(inf_f80, -3, 0);
534 try test__powixf2(inf_f80, -4, 0);
535 try test__powixf2(inf_f80, @bitCast(i32, @as(u32, 0x80000002)), 0);
536 try test__powixf2(inf_f80, @bitCast(i32, @as(u32, 0x80000001)), 0);
537 try test__powixf2(inf_f80, @bitCast(i32, @as(u32, 0x80000000)), 0);
538
539 try test__powixf2(-inf_f80, -1, -0.0);
540 try test__powixf2(-inf_f80, -2, 0);
541 try test__powixf2(-inf_f80, -3, -0.0);
542 try test__powixf2(-inf_f80, -4, 0);
543 try test__powixf2(-inf_f80, @bitCast(i32, @as(u32, 0x80000002)), 0);
544 try test__powixf2(-inf_f80, @bitCast(i32, @as(u32, 0x80000001)), -0.0);
545 try test__powixf2(-inf_f80, @bitCast(i32, @as(u32, 0x80000000)), 0);
541546
542547 try test__powixf2(2, 10, 1024.0);
543548 try test__powixf2(-2, 10, 1024.0);
lib/std/Build/Step/Compile.zig-5
......@@ -1032,11 +1032,6 @@ pub fn addObject(self: *Compile, obj: *Compile) void {
10321032 self.linkLibraryOrObject(obj);
10331033}
10341034
1035pub const addSystemIncludeDir = @compileError("deprecated; use addSystemIncludePath");
1036pub const addIncludeDir = @compileError("deprecated; use addIncludePath");
1037pub const addLibPath = @compileError("deprecated, use addLibraryPath");
1038pub const addFrameworkDir = @compileError("deprecated, use addFrameworkPath");
1039
10401035pub fn addSystemIncludePath(self: *Compile, path: []const u8) void {
10411036 const b = self.step.owner;
10421037 self.include_dirs.append(IncludeDir{ .raw_path_system = b.dupe(path) }) catch @panic("OOM");
lib/std/base64.zig+2-2
......@@ -302,7 +302,7 @@ pub const Base64DecoderWithIgnore = struct {
302302test "base64" {
303303 @setEvalBranchQuota(8000);
304304 try testBase64();
305 comptime try testAllApis(standard, "comptime", "Y29tcHRpbWU=");
305 try comptime testAllApis(standard, "comptime", "Y29tcHRpbWU=");
306306}
307307
308308test "base64 padding dest overflow" {
......@@ -322,7 +322,7 @@ test "base64 padding dest overflow" {
322322test "base64 url_safe_no_pad" {
323323 @setEvalBranchQuota(8000);
324324 try testBase64UrlSafeNoPad();
325 comptime try testAllApis(url_safe_no_pad, "comptime", "Y29tcHRpbWU");
325 try comptime testAllApis(url_safe_no_pad, "comptime", "Y29tcHRpbWU");
326326}
327327
328328fn testBase64() !void {
lib/std/builtin.zig-3
......@@ -221,7 +221,6 @@ pub const SourceLocation = struct {
221221};
222222
223223pub const TypeId = std.meta.Tag(Type);
224pub const TypeInfo = @compileError("deprecated; use Type");
225224
226225/// This data structure is used by the Zig language code generation and
227226/// therefore must be kept in sync with the compiler implementation.
......@@ -388,8 +387,6 @@ pub const Type = union(enum) {
388387 decls: []const Declaration,
389388 };
390389
391 pub const FnArg = @compileError("deprecated; use Fn.Param");
392
393390 /// This data structure is used by the Zig language code generation and
394391 /// therefore must be kept in sync with the compiler implementation.
395392 pub const Fn = struct {
lib/std/crypto/25519/ed25519.zig-6
......@@ -480,13 +480,7 @@ pub const Ed25519 = struct {
480480 hx.final(&blind_h);
481481 return blind_h;
482482 }
483
484 pub const sign = @compileError("deprecated; use BlindKeyPair.sign instead");
485 pub const unblindPublicKey = @compileError("deprecated; use BlindPublicKey.unblind instead");
486483 };
487
488 pub const sign = @compileError("deprecated; use KeyPair.sign instead");
489 pub const verify = @compileError("deprecated; use PublicKey.verify instead");
490484};
491485
492486test "ed25519 key pair creation" {
lib/std/cstr.zig+1-1
......@@ -22,7 +22,7 @@ pub fn cmp(a: [*:0]const u8, b: [*:0]const u8) i8 {
2222}
2323
2424test "cstr fns" {
25 comptime try testCStrFnsImpl();
25 try comptime testCStrFnsImpl();
2626 try testCStrFnsImpl();
2727}
2828
lib/std/debug.zig-2
......@@ -81,8 +81,6 @@ const PdbOrDwarf = union(enum) {
8181
8282var stderr_mutex = std.Thread.Mutex{};
8383
84pub const warn = @compileError("deprecated; use `std.log` functions for logging or `std.debug.print` for 'printf debugging'");
85
8684/// Print to stderr, unbuffered, and silently returning on failure. Intended
8785/// for use in "printf debugging." Use `std.log` functions for proper logging.
8886pub fn print(comptime fmt: []const u8, args: anytype) void {
lib/std/fifo.zig-2
......@@ -117,8 +117,6 @@ pub fn LinearFifo(
117117 }
118118 }
119119
120 pub const ensureCapacity = @compileError("deprecated; call `ensureUnusedCapacity` or `ensureTotalCapacity`");
121
122120 /// Ensure that the buffer can fit at least `size` items
123121 pub fn ensureTotalCapacity(self: *Self, size: usize) !void {
124122 if (self.buf.len >= size) return;
lib/std/fmt.zig+2-10
......@@ -727,12 +727,6 @@ fn formatValue(
727727 options: FormatOptions,
728728 writer: anytype,
729729) !void {
730 if (comptime std.mem.eql(u8, fmt, "B")) {
731 @compileError("specifier 'B' has been deprecated, wrap your argument in std.fmt.fmtIntSizeDec instead");
732 } else if (comptime std.mem.eql(u8, fmt, "Bi")) {
733 @compileError("specifier 'Bi' has been deprecated, wrap your argument in std.fmt.fmtIntSizeBin instead");
734 }
735
736730 const T = @TypeOf(value);
737731 switch (@typeInfo(T)) {
738732 .Float, .ComptimeFloat => return formatFloatValue(value, fmt, options, writer),
......@@ -977,12 +971,10 @@ fn checkTextFmt(comptime fmt: []const u8) void {
977971 if (fmt.len != 1)
978972 @compileError("unsupported format string '" ++ fmt ++ "' when formatting text");
979973 switch (fmt[0]) {
974 // Example of deprecation:
975 // '[deprecated_specifier]' => @compileError("specifier '[deprecated_specifier]' has been deprecated, wrap your argument in `std.some_function` instead"),
980976 'x' => @compileError("specifier 'x' has been deprecated, wrap your argument in std.fmt.fmtSliceHexLower instead"),
981977 'X' => @compileError("specifier 'X' has been deprecated, wrap your argument in std.fmt.fmtSliceHexUpper instead"),
982 'e' => @compileError("specifier 'e' has been deprecated, wrap your argument in std.fmt.fmtSliceEscapeLower instead"),
983 'E' => @compileError("specifier 'E' has been deprecated, wrap your argument in std.fmt.fmtSliceEscapeUpper instead"),
984 'z' => @compileError("specifier 'z' has been deprecated, wrap your argument in std.zig.fmtId instead"),
985 'Z' => @compileError("specifier 'Z' has been deprecated, wrap your argument in std.zig.fmtEscapes instead"),
986978 else => {},
987979 }
988980}
lib/std/hash/auto_hash.zig+4-4
......@@ -408,13 +408,13 @@ test "testHash union" {
408408}
409409
410410test "testHash vector" {
411 const a: meta.Vector(4, u32) = [_]u32{ 1, 2, 3, 4 };
412 const b: meta.Vector(4, u32) = [_]u32{ 1, 2, 3, 5 };
411 const a: @Vector(4, u32) = [_]u32{ 1, 2, 3, 4 };
412 const b: @Vector(4, u32) = [_]u32{ 1, 2, 3, 5 };
413413 try testing.expect(testHash(a) == testHash(a));
414414 try testing.expect(testHash(a) != testHash(b));
415415
416 const c: meta.Vector(4, u31) = [_]u31{ 1, 2, 3, 4 };
417 const d: meta.Vector(4, u31) = [_]u31{ 1, 2, 3, 5 };
416 const c: @Vector(4, u31) = [_]u31{ 1, 2, 3, 4 };
417 const d: @Vector(4, u31) = [_]u31{ 1, 2, 3, 5 };
418418 try testing.expect(testHash(c) == testHash(c));
419419 try testing.expect(testHash(c) != testHash(d));
420420}
lib/std/io.zig-3
......@@ -148,9 +148,6 @@ pub const changeDetectionStream = @import("io/change_detection_stream.zig").chan
148148pub const FindByteWriter = @import("io/find_byte_writer.zig").FindByteWriter;
149149pub const findByteWriter = @import("io/find_byte_writer.zig").findByteWriter;
150150
151pub const FindByteOutStream = @compileError("deprecated; use `FindByteWriter`");
152pub const findByteOutStream = @compileError("deprecated; use `findByteWriter`");
153
154151pub const BufferedAtomicFile = @import("io/buffered_atomic_file.zig").BufferedAtomicFile;
155152
156153pub const StreamSource = @import("io/stream_source.zig").StreamSource;
lib/std/math.zig+134-51
......@@ -48,43 +48,41 @@ pub const floatMax = @import("math/float.zig").floatMax;
4848pub const floatEps = @import("math/float.zig").floatEps;
4949pub const inf = @import("math/float.zig").inf;
5050
51// TODO Replace with @compileError("deprecated for foobar") after 0.10.0 is released.
52pub const f16_true_min: comptime_float = floatTrueMin(f16); // prev: 0.000000059604644775390625
53pub const f32_true_min: comptime_float = floatTrueMin(f32); // prev: 1.40129846432481707092e-45
54pub const f64_true_min: comptime_float = floatTrueMin(f64); // prev: 4.94065645841246544177e-324
55pub const f80_true_min = floatTrueMin(f80); // prev: make_f80(.{ .fraction = 1, .exp = 0 })
56pub const f128_true_min = floatTrueMin(f128); // prev: @bitCast(f128, @as(u128, 0x00000000000000000000000000000001))
57pub const f16_min: comptime_float = floatMin(f16); // prev: 0.00006103515625
58pub const f32_min: comptime_float = floatMin(f32); // prev: 1.17549435082228750797e-38
59pub const f64_min: comptime_float = floatMin(f64); // prev: 2.2250738585072014e-308
60pub const f80_min = floatMin(f80); // prev: make_f80(.{ .fraction = 0x8000000000000000, .exp = 1 })
61pub const f128_min = floatMin(f128); // prev: @bitCast(f128, @as(u128, 0x00010000000000000000000000000000))
62pub const f16_max: comptime_float = floatMax(f16); // prev: 65504
63pub const f32_max: comptime_float = floatMax(f32); // prev: 3.40282346638528859812e+38
64pub const f64_max: comptime_float = floatMax(f64); // prev: 1.79769313486231570815e+308
65pub const f80_max = floatMax(f80); // prev: make_f80(.{ .fraction = 0xFFFFFFFFFFFFFFFF, .exp = 0x7FFE })
66pub const f128_max = floatMax(f128); // prev: @bitCast(f128, @as(u128, 0x7FFEFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
67pub const f16_epsilon: comptime_float = floatEps(f16); // prev: 0.0009765625
68pub const f32_epsilon: comptime_float = floatEps(f32); // prev: 1.1920928955078125e-07
69pub const f64_epsilon: comptime_float = floatEps(f64); // prev: 2.22044604925031308085e-16
70pub const f80_epsilon = floatEps(f80); // prev: make_f80(.{ .fraction = 0x8000000000000000, .exp = 0x3FC0 })
71pub const f128_epsilon = floatEps(f128); // prev: @bitCast(f128, @as(u128, 0x3F8F0000000000000000000000000000))
72pub const f16_toint: comptime_float = 1.0 / f16_epsilon; // same as before
73pub const f32_toint: comptime_float = 1.0 / f32_epsilon; // same as before
74pub const f64_toint: comptime_float = 1.0 / f64_epsilon; // same as before
75pub const f80_toint = 1.0 / f80_epsilon; // same as before
76pub const f128_toint = 1.0 / f128_epsilon; // same as before
77pub const inf_u16 = @bitCast(u16, inf_f16); // prev: @as(u16, 0x7C00)
78pub const inf_f16 = inf(f16); // prev: @bitCast(f16, inf_u16)
79pub const inf_u32 = @bitCast(u32, inf_f32); // prev: @as(u32, 0x7F800000)
80pub const inf_f32 = inf(f32); // prev: @bitCast(f32, inf_u32)
81pub const inf_u64 = @bitCast(u64, inf_f64); // prev: @as(u64, 0x7FF << 52)
82pub const inf_f64 = inf(f64); // prev: @bitCast(f64, inf_u64)
83pub const inf_f80 = inf(f80); // prev: make_f80(F80{ .fraction = 0x8000000000000000, .exp = 0x7fff })
84pub const inf_u128 = @bitCast(u128, inf_f128); // prev: @as(u128, 0x7fff0000000000000000000000000000)
85pub const inf_f128 = inf(f128); // prev: @bitCast(f128, inf_u128)
86pub const epsilon = floatEps;
87// End of "soft deprecated" section
51pub const f16_true_min = @compileError("Deprecated: use `floatTrueMin(f16)` instead");
52pub const f32_true_min = @compileError("Deprecated: use `floatTrueMin(f32)` instead");
53pub const f64_true_min = @compileError("Deprecated: use `floatTrueMin(f64)` instead");
54pub const f80_true_min = @compileError("Deprecated: use `floatTrueMin(f80)` instead");
55pub const f128_true_min = @compileError("Deprecated: use `floatTrueMin(f128)` instead");
56pub const f16_min = @compileError("Deprecated: use `floatMin(f16)` instead");
57pub const f32_min = @compileError("Deprecated: use `floatMin(f32)` instead");
58pub const f64_min = @compileError("Deprecated: use `floatMin(f64)` instead");
59pub const f80_min = @compileError("Deprecated: use `floatMin(f80)` instead");
60pub const f128_min = @compileError("Deprecated: use `floatMin(f128)` instead");
61pub const f16_max = @compileError("Deprecated: use `floatMax(f16)` instead");
62pub const f32_max = @compileError("Deprecated: use `floatMax(f32)` instead");
63pub const f64_max = @compileError("Deprecated: use `floatMax(f64)` instead");
64pub const f80_max = @compileError("Deprecated: use `floatMax(f80)` instead");
65pub const f128_max = @compileError("Deprecated: use `floatMax(f128)` instead");
66pub const f16_epsilon = @compileError("Deprecated: use `floatEps(f16)` instead");
67pub const f32_epsilon = @compileError("Deprecated: use `floatEps(f32)` instead");
68pub const f64_epsilon = @compileError("Deprecated: use `floatEps(f64)` instead");
69pub const f80_epsilon = @compileError("Deprecated: use `floatEps(f80)` instead");
70pub const f128_epsilon = @compileError("Deprecated: use `floatEps(f128)` instead");
71pub const f16_toint = @compileError("Deprecated: use `1.0 / floatEps(f16)` instead");
72pub const f32_toint = @compileError("Deprecated: use `1.0 / floatEps(f32)` instead");
73pub const f64_toint = @compileError("Deprecated: use `1.0 / floatEps(f64)` instead");
74pub const f80_toint = @compileError("Deprecated: use `1.0 / floatEps(f80)` instead");
75pub const f128_toint = @compileError("Deprecated: use `1.0 / floatEps(f128)` instead");
76pub const inf_u16 = @compileError("Deprecated: use `@bitCast(u16, inf(f16))` instead");
77pub const inf_f16 = @compileError("Deprecated: use `inf(f16)` instead");
78pub const inf_u32 = @compileError("Deprecated: use `@bitCast(u32, inf(f32))` instead");
79pub const inf_f32 = @compileError("Deprecated: use `inf(f32)` instead");
80pub const inf_u64 = @compileError("Deprecated: use `@bitCast(u64, inf(f64))` instead");
81pub const inf_f64 = @compileError("Deprecated: use `inf(f64)` instead");
82pub const inf_f80 = @compileError("Deprecated: use `inf(f80)` instead");
83pub const inf_u128 = @compileError("Deprecated: use `@bitCast(u128, inf(f128))` instead");
84pub const inf_f128 = @compileError("Deprecated: use `inf(f128)` instead");
85pub const epsilon = @compileError("Deprecated: use `floatEps` instead");
8886
8987pub const nan_u16 = @as(u16, 0x7C01);
9088pub const nan_f16 = @bitCast(f16, nan_u16);
......@@ -329,7 +327,92 @@ pub const Complex = complex.Complex;
329327pub const big = @import("math/big.zig");
330328
331329test {
332 std.testing.refAllDecls(@This());
330 _ = floatExponentBits;
331 _ = floatMantissaBits;
332 _ = floatFractionalBits;
333 _ = floatExponentMin;
334 _ = floatExponentMax;
335 _ = floatTrueMin;
336 _ = floatMin;
337 _ = floatMax;
338 _ = floatEps;
339 _ = inf;
340
341 _ = nan_u16;
342 _ = nan_f16;
343
344 _ = qnan_u16;
345 _ = qnan_f16;
346
347 _ = nan_u32;
348 _ = nan_f32;
349
350 _ = qnan_u32;
351 _ = qnan_f32;
352
353 _ = nan_u64;
354 _ = nan_f64;
355
356 _ = qnan_u64;
357 _ = qnan_f64;
358
359 _ = nan_f80;
360 _ = qnan_f80;
361
362 _ = nan_u128;
363 _ = nan_f128;
364
365 _ = qnan_u128;
366 _ = qnan_f128;
367
368 _ = nan;
369 _ = snan;
370
371 _ = isNan;
372 _ = isSignalNan;
373 _ = frexp;
374 _ = Frexp;
375 _ = modf;
376 _ = modf32_result;
377 _ = modf64_result;
378 _ = copysign;
379 _ = isFinite;
380 _ = isInf;
381 _ = isPositiveInf;
382 _ = isNegativeInf;
383 _ = isNormal;
384 _ = signbit;
385 _ = scalbn;
386 _ = ldexp;
387 _ = pow;
388 _ = powi;
389 _ = sqrt;
390 _ = cbrt;
391 _ = acos;
392 _ = asin;
393 _ = atan;
394 _ = atan2;
395 _ = hypot;
396 _ = expm1;
397 _ = ilogb;
398 _ = ln;
399 _ = log;
400 _ = log2;
401 _ = log10;
402 _ = log10_int;
403 _ = log1p;
404 _ = asinh;
405 _ = acosh;
406 _ = atanh;
407 _ = sinh;
408 _ = cosh;
409 _ = tanh;
410 _ = gcd;
411
412 _ = complex;
413 _ = Complex;
414
415 _ = big;
333416}
334417
335418/// Given two types, returns the smallest one which is capable of holding the
......@@ -771,7 +854,7 @@ test "IntFittingRange" {
771854
772855test "overflow functions" {
773856 try testOverflow();
774 comptime try testOverflow();
857 try comptime testOverflow();
775858}
776859
777860fn testOverflow() !void {
......@@ -815,7 +898,7 @@ pub fn absInt(x: anytype) !@TypeOf(x) {
815898
816899test "absInt" {
817900 try testAbsInt();
818 comptime try testAbsInt();
901 try comptime testAbsInt();
819902}
820903fn testAbsInt() !void {
821904 try testing.expect((absInt(@as(i32, -10)) catch unreachable) == 10);
......@@ -837,7 +920,7 @@ pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {
837920
838921test "divTrunc" {
839922 try testDivTrunc();
840 comptime try testDivTrunc();
923 try comptime testDivTrunc();
841924}
842925fn testDivTrunc() !void {
843926 try testing.expect((divTrunc(i32, 5, 3) catch unreachable) == 1);
......@@ -861,7 +944,7 @@ pub fn divFloor(comptime T: type, numerator: T, denominator: T) !T {
861944
862945test "divFloor" {
863946 try testDivFloor();
864 comptime try testDivFloor();
947 try comptime testDivFloor();
865948}
866949fn testDivFloor() !void {
867950 try testing.expect((divFloor(i32, 5, 3) catch unreachable) == 1);
......@@ -898,7 +981,7 @@ pub fn divCeil(comptime T: type, numerator: T, denominator: T) !T {
898981
899982test "divCeil" {
900983 try testDivCeil();
901 comptime try testDivCeil();
984 try comptime testDivCeil();
902985}
903986fn testDivCeil() !void {
904987 try testing.expectEqual(@as(i32, 2), divCeil(i32, 5, 3) catch unreachable);
......@@ -942,7 +1025,7 @@ pub fn divExact(comptime T: type, numerator: T, denominator: T) !T {
9421025
9431026test "divExact" {
9441027 try testDivExact();
945 comptime try testDivExact();
1028 try comptime testDivExact();
9461029}
9471030fn testDivExact() !void {
9481031 try testing.expect((divExact(i32, 10, 5) catch unreachable) == 2);
......@@ -968,7 +1051,7 @@ pub fn mod(comptime T: type, numerator: T, denominator: T) !T {
9681051
9691052test "mod" {
9701053 try testMod();
971 comptime try testMod();
1054 try comptime testMod();
9721055}
9731056fn testMod() !void {
9741057 try testing.expect((mod(i32, -5, 3) catch unreachable) == 1);
......@@ -994,7 +1077,7 @@ pub fn rem(comptime T: type, numerator: T, denominator: T) !T {
9941077
9951078test "rem" {
9961079 try testRem();
997 comptime try testRem();
1080 try comptime testRem();
9981081}
9991082fn testRem() !void {
10001083 try testing.expect((rem(i32, -5, 3) catch unreachable) == -2);
......@@ -1170,7 +1253,7 @@ pub fn floorPowerOfTwo(comptime T: type, value: T) T {
11701253
11711254test "floorPowerOfTwo" {
11721255 try testFloorPowerOfTwo();
1173 comptime try testFloorPowerOfTwo();
1256 try comptime testFloorPowerOfTwo();
11741257}
11751258
11761259fn testFloorPowerOfTwo() !void {
......@@ -1232,7 +1315,7 @@ pub fn ceilPowerOfTwoAssert(comptime T: type, value: T) T {
12321315
12331316test "ceilPowerOfTwoPromote" {
12341317 try testCeilPowerOfTwoPromote();
1235 comptime try testCeilPowerOfTwoPromote();
1318 try comptime testCeilPowerOfTwoPromote();
12361319}
12371320
12381321fn testCeilPowerOfTwoPromote() !void {
......@@ -1249,7 +1332,7 @@ fn testCeilPowerOfTwoPromote() !void {
12491332
12501333test "ceilPowerOfTwo" {
12511334 try testCeilPowerOfTwo();
1252 comptime try testCeilPowerOfTwo();
1335 try comptime testCeilPowerOfTwo();
12531336}
12541337
12551338fn testCeilPowerOfTwo() !void {
......@@ -1668,7 +1751,7 @@ test "boolMask" {
16681751 }
16691752 }.runTest;
16701753 try runTest();
1671 comptime try runTest();
1754 try comptime runTest();
16721755}
16731756
16741757/// Return the mod of `num` with the smallest integer type
......@@ -1799,5 +1882,5 @@ test "sign" {
17991882 return error.SkipZigTest;
18001883 }
18011884 try testSign();
1802 comptime try testSign();
1885 try comptime testSign();
18031886}
lib/std/mem.zig+6-6
......@@ -3101,7 +3101,7 @@ test "testStringEquality" {
31013101
31023102test "testReadInt" {
31033103 try testReadIntImpl();
3104 comptime try testReadIntImpl();
3104 try comptime testReadIntImpl();
31053105}
31063106fn testReadIntImpl() !void {
31073107 {
......@@ -3152,7 +3152,7 @@ fn testReadIntImpl() !void {
31523152
31533153test writeIntSlice {
31543154 try testWriteIntImpl();
3155 comptime try testWriteIntImpl();
3155 try comptime testWriteIntImpl();
31563156}
31573157fn testWriteIntImpl() !void {
31583158 var bytes: [8]u8 = undefined;
......@@ -4069,13 +4069,13 @@ test "bytesAsSlice keeps pointer alignment" {
40694069 {
40704070 var bytes = [_]u8{ 0x01, 0x02, 0x03, 0x04 };
40714071 const numbers = bytesAsSlice(u32, bytes[0..]);
4072 comptime try testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
4072 try comptime testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
40734073 }
40744074 {
40754075 var bytes = [_]u8{ 0x01, 0x02, 0x03, 0x04 };
40764076 var runtime_zero: usize = 0;
40774077 const numbers = bytesAsSlice(u32, bytes[runtime_zero..]);
4078 comptime try testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
4078 try comptime testing.expect(@TypeOf(numbers) == []align(@alignOf(@TypeOf(bytes))) u32);
40794079 }
40804080}
40814081
......@@ -4168,7 +4168,7 @@ test "sliceAsBytes packed struct at runtime and comptime" {
41684168 }
41694169 };
41704170 try S.doTheTest();
4171 comptime try S.doTheTest();
4171 try comptime S.doTheTest();
41724172}
41734173
41744174test "sliceAsBytes and bytesAsSlice back" {
......@@ -4557,7 +4557,7 @@ test "read/write(Var)PackedInt" {
45574557 }
45584558
45594559 const signedness = @typeInfo(PackedType).Int.signedness;
4560 const NextPowerOfTwoInt = std.meta.Int(signedness, comptime try std.math.ceilPowerOfTwo(u16, @bitSizeOf(PackedType)));
4560 const NextPowerOfTwoInt = std.meta.Int(signedness, try comptime std.math.ceilPowerOfTwo(u16, @bitSizeOf(PackedType)));
45614561 const ui64 = std.meta.Int(signedness, 64);
45624562 inline for ([_]type{ PackedType, NextPowerOfTwoInt, ui64 }) |U| {
45634563 { // Variable-size Read/Write (Native-endian)
lib/std/meta.zig+4-16
......@@ -146,7 +146,7 @@ test "std.meta.Child" {
146146 try testing.expect(Child(*u8) == u8);
147147 try testing.expect(Child([]u8) == u8);
148148 try testing.expect(Child(?u8) == u8);
149 try testing.expect(Child(Vector(2, u8)) == u8);
149 try testing.expect(Child(@Vector(2, u8)) == u8);
150150}
151151
152152/// Given a "memory span" type (array, slice, vector, or pointer to such), returns the "element type".
......@@ -173,8 +173,8 @@ test "std.meta.Elem" {
173173 try testing.expect(Elem([*]u8) == u8);
174174 try testing.expect(Elem([]u8) == u8);
175175 try testing.expect(Elem(*[10]u8) == u8);
176 try testing.expect(Elem(Vector(2, u8)) == u8);
177 try testing.expect(Elem(*Vector(2, u8)) == u8);
176 try testing.expect(Elem(@Vector(2, u8)) == u8);
177 try testing.expect(Elem(*@Vector(2, u8)) == u8);
178178 try testing.expect(Elem(?[*]u8) == u8);
179179}
180180
......@@ -210,7 +210,7 @@ pub fn sentinel(comptime T: type) ?Elem(T) {
210210
211211test "std.meta.sentinel" {
212212 try testSentinel();
213 comptime try testSentinel();
213 try comptime testSentinel();
214214}
215215
216216fn testSentinel() !void {
......@@ -711,8 +711,6 @@ test "std.meta.DeclEnum" {
711711 try expectEqualEnum(enum { a, b, c }, DeclEnum(C));
712712}
713713
714pub const TagType = @compileError("deprecated; use Tag");
715
716714pub fn Tag(comptime T: type) type {
717715 return switch (@typeInfo(T)) {
718716 .Enum => |info| info.tag_type,
......@@ -1014,16 +1012,6 @@ test "std.meta.Float" {
10141012 try testing.expectEqual(f128, Float(128));
10151013}
10161014
1017/// Deprecated. Use `@Vector`.
1018pub fn Vector(comptime len: u32, comptime child: type) type {
1019 return @Type(.{
1020 .Vector = .{
1021 .len = len,
1022 .child = child,
1023 },
1024 });
1025}
1026
10271015/// For a given function type, returns a tuple type which fields will
10281016/// correspond to the argument types.
10291017///
lib/std/meta/trait.zig+3-3
......@@ -222,8 +222,8 @@ pub fn isSingleItemPtr(comptime T: type) bool {
222222
223223test "isSingleItemPtr" {
224224 const array = [_]u8{0} ** 10;
225 comptime try testing.expect(isSingleItemPtr(@TypeOf(&array[0])));
226 comptime try testing.expect(!isSingleItemPtr(@TypeOf(array)));
225 try comptime testing.expect(isSingleItemPtr(@TypeOf(&array[0])));
226 try comptime testing.expect(!isSingleItemPtr(@TypeOf(array)));
227227 var runtime_zero: usize = 0;
228228 try testing.expect(!isSingleItemPtr(@TypeOf(array[runtime_zero..1])));
229229}
......@@ -271,7 +271,7 @@ pub fn isIndexable(comptime T: type) bool {
271271test "isIndexable" {
272272 const array = [_]u8{0} ** 10;
273273 const slice = @as([]const u8, &array);
274 const vector: meta.Vector(2, u32) = [_]u32{0} ** 2;
274 const vector: @Vector(2, u32) = [_]u32{0} ** 2;
275275 const tuple = .{ 1, 2, 3 };
276276
277277 try testing.expect(isIndexable(@TypeOf(array)));
lib/std/rand.zig+1-1
......@@ -410,7 +410,7 @@ pub const Random = struct {
410410 r.uintLessThan(T, sum)
411411 else if (comptime std.meta.trait.isFloat(T))
412412 // take care that imprecision doesn't lead to a value slightly greater than sum
413 std.math.min(r.float(T) * sum, sum - std.math.epsilon(T))
413 std.math.min(r.float(T) * sum, sum - std.math.floatEps(T))
414414 else
415415 @compileError("weightedIndex does not support proportions of type " ++ @typeName(T));
416416
lib/std/rand/test.zig+5-5
......@@ -79,7 +79,7 @@ const Dilbert = struct {
7979
8080test "Random int" {
8181 try testRandomInt();
82 comptime try testRandomInt();
82 try comptime testRandomInt();
8383}
8484fn testRandomInt() !void {
8585 var rng = SequentialPrng.init();
......@@ -126,7 +126,7 @@ fn testRandomInt() !void {
126126
127127test "Random boolean" {
128128 try testRandomBoolean();
129 comptime try testRandomBoolean();
129 try comptime testRandomBoolean();
130130}
131131fn testRandomBoolean() !void {
132132 var rng = SequentialPrng.init();
......@@ -140,7 +140,7 @@ fn testRandomBoolean() !void {
140140
141141test "Random enum" {
142142 try testRandomEnumValue();
143 comptime try testRandomEnumValue();
143 try comptime testRandomEnumValue();
144144}
145145fn testRandomEnumValue() !void {
146146 const TestEnum = enum {
......@@ -159,7 +159,7 @@ fn testRandomEnumValue() !void {
159159test "Random intLessThan" {
160160 @setEvalBranchQuota(10000);
161161 try testRandomIntLessThan();
162 comptime try testRandomIntLessThan();
162 try comptime testRandomIntLessThan();
163163}
164164fn testRandomIntLessThan() !void {
165165 var rng = SequentialPrng.init();
......@@ -201,7 +201,7 @@ fn testRandomIntLessThan() !void {
201201test "Random intAtMost" {
202202 @setEvalBranchQuota(10000);
203203 try testRandomIntAtMost();
204 comptime try testRandomIntAtMost();
204 try comptime testRandomIntAtMost();
205205}
206206fn testRandomIntAtMost() !void {
207207 var rng = SequentialPrng.init();
lib/std/testing.zig+1-1
......@@ -263,7 +263,7 @@ pub fn expectApproxEqRel(expected: anytype, actual: @TypeOf(expected), tolerance
263263
264264test "expectApproxEqRel" {
265265 inline for ([_]type{ f16, f32, f64, f128 }) |T| {
266 const eps_value = comptime math.epsilon(T);
266 const eps_value = comptime math.floatEps(T);
267267 const sqrt_eps_value = comptime @sqrt(eps_value);
268268
269269 const pos_x: T = 12.0;
lib/std/unicode.zig+15-15
......@@ -354,11 +354,11 @@ fn testUtf16CountCodepoints() !void {
354354
355355test "utf16 count codepoints" {
356356 try testUtf16CountCodepoints();
357 comptime try testUtf16CountCodepoints();
357 try comptime testUtf16CountCodepoints();
358358}
359359
360360test "utf8 encode" {
361 comptime try testUtf8Encode();
361 try comptime testUtf8Encode();
362362 try testUtf8Encode();
363363}
364364fn testUtf8Encode() !void {
......@@ -384,7 +384,7 @@ fn testUtf8Encode() !void {
384384}
385385
386386test "utf8 encode error" {
387 comptime try testUtf8EncodeError();
387 try comptime testUtf8EncodeError();
388388 try testUtf8EncodeError();
389389}
390390fn testUtf8EncodeError() !void {
......@@ -400,7 +400,7 @@ fn testErrorEncode(codePoint: u21, array: []u8, expectedErr: anyerror) !void {
400400}
401401
402402test "utf8 iterator on ascii" {
403 comptime try testUtf8IteratorOnAscii();
403 try comptime testUtf8IteratorOnAscii();
404404 try testUtf8IteratorOnAscii();
405405}
406406fn testUtf8IteratorOnAscii() !void {
......@@ -420,7 +420,7 @@ fn testUtf8IteratorOnAscii() !void {
420420}
421421
422422test "utf8 view bad" {
423 comptime try testUtf8ViewBad();
423 try comptime testUtf8ViewBad();
424424 try testUtf8ViewBad();
425425}
426426fn testUtf8ViewBad() !void {
......@@ -430,7 +430,7 @@ fn testUtf8ViewBad() !void {
430430}
431431
432432test "utf8 view ok" {
433 comptime try testUtf8ViewOk();
433 try comptime testUtf8ViewOk();
434434 try testUtf8ViewOk();
435435}
436436fn testUtf8ViewOk() !void {
......@@ -450,7 +450,7 @@ fn testUtf8ViewOk() !void {
450450}
451451
452452test "bad utf8 slice" {
453 comptime try testBadUtf8Slice();
453 try comptime testBadUtf8Slice();
454454 try testBadUtf8Slice();
455455}
456456fn testBadUtf8Slice() !void {
......@@ -461,7 +461,7 @@ fn testBadUtf8Slice() !void {
461461}
462462
463463test "valid utf8" {
464 comptime try testValidUtf8();
464 try comptime testValidUtf8();
465465 try testValidUtf8();
466466}
467467fn testValidUtf8() !void {
......@@ -480,7 +480,7 @@ fn testValidUtf8() !void {
480480}
481481
482482test "invalid utf8 continuation bytes" {
483 comptime try testInvalidUtf8ContinuationBytes();
483 try comptime testInvalidUtf8ContinuationBytes();
484484 try testInvalidUtf8ContinuationBytes();
485485}
486486fn testInvalidUtf8ContinuationBytes() !void {
......@@ -512,7 +512,7 @@ fn testInvalidUtf8ContinuationBytes() !void {
512512}
513513
514514test "overlong utf8 codepoint" {
515 comptime try testOverlongUtf8Codepoint();
515 try comptime testOverlongUtf8Codepoint();
516516 try testOverlongUtf8Codepoint();
517517}
518518fn testOverlongUtf8Codepoint() !void {
......@@ -525,7 +525,7 @@ fn testOverlongUtf8Codepoint() !void {
525525}
526526
527527test "misc invalid utf8" {
528 comptime try testMiscInvalidUtf8();
528 try comptime testMiscInvalidUtf8();
529529 try testMiscInvalidUtf8();
530530}
531531fn testMiscInvalidUtf8() !void {
......@@ -540,7 +540,7 @@ fn testMiscInvalidUtf8() !void {
540540}
541541
542542test "utf8 iterator peeking" {
543 comptime try testUtf8Peeking();
543 try comptime testUtf8Peeking();
544544 try testUtf8Peeking();
545545}
546546
......@@ -813,7 +813,7 @@ fn testCalcUtf16LeLen() !void {
813813
814814test "calculate utf16 string length of given utf8 string in u16" {
815815 try testCalcUtf16LeLen();
816 comptime try testCalcUtf16LeLen();
816 try comptime testCalcUtf16LeLen();
817817}
818818
819819/// Print the given `utf16le` string
......@@ -919,7 +919,7 @@ fn testUtf8CountCodepoints() !void {
919919
920920test "utf8 count codepoints" {
921921 try testUtf8CountCodepoints();
922 comptime try testUtf8CountCodepoints();
922 try comptime testUtf8CountCodepoints();
923923}
924924
925925fn testUtf8ValidCodepoint() !void {
......@@ -935,5 +935,5 @@ fn testUtf8ValidCodepoint() !void {
935935
936936test "utf8 valid codepoint" {
937937 try testUtf8ValidCodepoint();
938 comptime try testUtf8ValidCodepoint();
938 try comptime testUtf8ValidCodepoint();
939939}
test/behavior/align.zig+8-8
......@@ -7,11 +7,11 @@ const assert = std.debug.assert;
77var foo: u8 align(4) = 100;
88
99test "global variable alignment" {
10 comptime try expect(@typeInfo(@TypeOf(&foo)).Pointer.alignment == 4);
11 comptime try expect(@TypeOf(&foo) == *align(4) u8);
10 try comptime expect(@typeInfo(@TypeOf(&foo)).Pointer.alignment == 4);
11 try comptime expect(@TypeOf(&foo) == *align(4) u8);
1212 {
1313 const slice = @as(*align(4) [1]u8, &foo)[0..];
14 comptime try expect(@TypeOf(slice) == *align(4) [1]u8);
14 try comptime expect(@TypeOf(slice) == *align(4) [1]u8);
1515 }
1616}
1717
......@@ -396,7 +396,7 @@ test "function align expression depends on generic parameter" {
396396 }
397397 };
398398 try S.doTheTest();
399 comptime try S.doTheTest();
399 try comptime S.doTheTest();
400400}
401401
402402test "function callconv expression depends on generic parameter" {
......@@ -414,7 +414,7 @@ test "function callconv expression depends on generic parameter" {
414414 }
415415 };
416416 try S.doTheTest();
417 comptime try S.doTheTest();
417 try comptime S.doTheTest();
418418}
419419
420420test "runtime-known array index has best alignment possible" {
......@@ -452,10 +452,10 @@ test "runtime-known array index has best alignment possible" {
452452 try testIndex2(&array, 3, *u8);
453453}
454454fn testIndex(smaller: [*]align(2) u32, index: usize, comptime T: type) !void {
455 comptime try expect(@TypeOf(&smaller[index]) == T);
455 try comptime expect(@TypeOf(&smaller[index]) == T);
456456}
457457fn testIndex2(ptr: [*]align(4) u8, index: usize, comptime T: type) !void {
458 comptime try expect(@TypeOf(&ptr[index]) == T);
458 try comptime expect(@TypeOf(&ptr[index]) == T);
459459}
460460
461461test "alignment of function with c calling convention" {
......@@ -517,7 +517,7 @@ test "struct field explicit alignment" {
517517 var node: S.Node = undefined;
518518 node.massive_byte = 100;
519519 try expect(node.massive_byte == 100);
520 comptime try expect(@TypeOf(&node.massive_byte) == *align(64) u8);
520 try comptime expect(@TypeOf(&node.massive_byte) == *align(64) u8);
521521 try expect(@ptrToInt(&node.massive_byte) % 64 == 0);
522522}
523523
test/behavior/alignof.zig+2-2
......@@ -11,9 +11,9 @@ const Foo = struct {
1111};
1212
1313test "@alignOf(T) before referencing T" {
14 comptime try expect(@alignOf(Foo) != maxInt(usize));
14 try comptime expect(@alignOf(Foo) != maxInt(usize));
1515 if (native_arch == .x86_64) {
16 comptime try expect(@alignOf(Foo) == 4);
16 try comptime expect(@alignOf(Foo) == 4);
1717 }
1818}
1919
test/behavior/array.zig+15-15
......@@ -67,7 +67,7 @@ test "array concat with undefined" {
6767 };
6868
6969 try S.doTheTest();
70 comptime try S.doTheTest();
70 try comptime S.doTheTest();
7171}
7272
7373test "array concat with tuple" {
......@@ -154,9 +154,9 @@ test "array len field" {
154154 var arr = [4]u8{ 0, 0, 0, 0 };
155155 var ptr = &arr;
156156 try expect(arr.len == 4);
157 comptime try expect(arr.len == 4);
157 try comptime expect(arr.len == 4);
158158 try expect(ptr.len == 4);
159 comptime try expect(ptr.len == 4);
159 try comptime expect(ptr.len == 4);
160160 try expect(@TypeOf(arr.len) == usize);
161161}
162162
......@@ -186,7 +186,7 @@ test "array with sentinels" {
186186 };
187187
188188 try S.doTheTest(false);
189 comptime try S.doTheTest(true);
189 try comptime S.doTheTest(true);
190190}
191191
192192test "void arrays" {
......@@ -247,7 +247,7 @@ test "single-item pointer to array indexing and slicing" {
247247 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
248248
249249 try testSingleItemPtrArrayIndexSlice();
250 comptime try testSingleItemPtrArrayIndexSlice();
250 try comptime testSingleItemPtrArrayIndexSlice();
251251}
252252
253253fn testSingleItemPtrArrayIndexSlice() !void {
......@@ -300,7 +300,7 @@ test "anonymous list literal syntax" {
300300 }
301301 };
302302 try S.doTheTest();
303 comptime try S.doTheTest();
303 try comptime S.doTheTest();
304304}
305305
306306var s_array: [8]Sub = undefined;
......@@ -349,7 +349,7 @@ test "implicit cast single-item pointer" {
349349 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
350350
351351 try testImplicitCastSingleItemPtr();
352 comptime try testImplicitCastSingleItemPtr();
352 try comptime testImplicitCastSingleItemPtr();
353353}
354354
355355fn testImplicitCastSingleItemPtr() !void {
......@@ -410,7 +410,7 @@ test "array literal as argument to function" {
410410 }
411411 };
412412 try S.entry(2);
413 comptime try S.entry(2);
413 try comptime S.entry(2);
414414}
415415
416416test "double nested array to const slice cast in array literal" {
......@@ -472,7 +472,7 @@ test "double nested array to const slice cast in array literal" {
472472 }
473473 };
474474 try S.entry(2);
475 comptime try S.entry(2);
475 try comptime S.entry(2);
476476}
477477
478478test "anonymous literal in array" {
......@@ -498,7 +498,7 @@ test "anonymous literal in array" {
498498 }
499499 };
500500 try S.doTheTest();
501 comptime try S.doTheTest();
501 try comptime S.doTheTest();
502502}
503503
504504test "access the null element of a null terminated array" {
......@@ -515,7 +515,7 @@ test "access the null element of a null terminated array" {
515515 }
516516 };
517517 try S.doTheTest();
518 comptime try S.doTheTest();
518 try comptime S.doTheTest();
519519}
520520
521521test "type deduction for array subscript expression" {
......@@ -534,7 +534,7 @@ test "type deduction for array subscript expression" {
534534 }
535535 };
536536 try S.doTheTest();
537 comptime try S.doTheTest();
537 try comptime S.doTheTest();
538538}
539539
540540test "sentinel element count towards the ABI size calculation" {
......@@ -558,7 +558,7 @@ test "sentinel element count towards the ABI size calculation" {
558558 };
559559
560560 try S.doTheTest();
561 comptime try S.doTheTest();
561 try comptime S.doTheTest();
562562}
563563
564564test "zero-sized array with recursive type definition" {
......@@ -613,7 +613,7 @@ test "type coercion of anon struct literal to array" {
613613 }
614614 };
615615 try S.doTheTest();
616 comptime try S.doTheTest();
616 try comptime S.doTheTest();
617617}
618618
619619test "type coercion of pointer to anon struct literal to pointer to array" {
......@@ -646,7 +646,7 @@ test "type coercion of pointer to anon struct literal to pointer to array" {
646646 }
647647 };
648648 try S.doTheTest();
649 comptime try S.doTheTest();
649 try comptime S.doTheTest();
650650}
651651
652652test "array with comptime-only element type" {
test/behavior/async_fn.zig+3-3
......@@ -331,7 +331,7 @@ test "async fn pointer in a struct field" {
331331 var foo = Foo{ .bar = simpleAsyncFn2 };
332332 var bytes: [64]u8 align(16) = undefined;
333333 const f = @asyncCall(&bytes, {}, foo.bar, .{&data});
334 comptime try expect(@TypeOf(f) == anyframe->void);
334 try comptime expect(@TypeOf(f) == anyframe->void);
335335 try expect(data == 2);
336336 resume f;
337337 try expect(data == 4);
......@@ -1143,7 +1143,7 @@ test "@asyncCall using the result location inside the frame" {
11431143 var foo = Foo{ .bar = S.simple2 };
11441144 var bytes: [64]u8 align(16) = undefined;
11451145 const f = @asyncCall(&bytes, {}, foo.bar, .{&data});
1146 comptime try expect(@TypeOf(f) == anyframe->i32);
1146 try comptime expect(@TypeOf(f) == anyframe->i32);
11471147 try expect(data == 2);
11481148 resume f;
11491149 try expect(data == 4);
......@@ -1158,7 +1158,7 @@ test "@TypeOf an async function call of generic fn with error union type" {
11581158 const S = struct {
11591159 fn func(comptime x: anytype) anyerror!i32 {
11601160 const T = @TypeOf(async func(x));
1161 comptime try expect(T == @typeInfo(@TypeOf(@frame())).Pointer.child);
1161 try comptime expect(T == @typeInfo(@TypeOf(@frame())).Pointer.child);
11621162 return undefined;
11631163 }
11641164 };
test/behavior/atomics.zig+8-8
......@@ -17,7 +17,7 @@ test "cmpxchg" {
1717 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1818
1919 try testCmpxchg();
20 comptime try testCmpxchg();
20 try comptime testCmpxchg();
2121}
2222
2323fn testCmpxchg() !void {
......@@ -122,7 +122,7 @@ test "128-bit cmpxchg" {
122122 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
123123
124124 try test_u128_cmpxchg();
125 comptime try test_u128_cmpxchg();
125 try comptime test_u128_cmpxchg();
126126}
127127
128128fn test_u128_cmpxchg() !void {
......@@ -195,7 +195,7 @@ test "atomic store comptime" {
195195 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
196196 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
197197
198 comptime try testAtomicStore();
198 try comptime testAtomicStore();
199199 try testAtomicStore();
200200}
201201
......@@ -219,7 +219,7 @@ test "atomicrmw with floats" {
219219 return error.SkipZigTest;
220220 }
221221 try testAtomicRmwFloat();
222 comptime try testAtomicRmwFloat();
222 try comptime testAtomicRmwFloat();
223223}
224224
225225fn testAtomicRmwFloat() !void {
......@@ -244,7 +244,7 @@ test "atomicrmw with ints" {
244244 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
245245
246246 try testAtomicRmwInts();
247 comptime try testAtomicRmwInts();
247 try comptime testAtomicRmwInts();
248248}
249249
250250fn testAtomicRmwInts() !void {
......@@ -318,8 +318,8 @@ test "atomicrmw with 128-bit ints" {
318318
319319 try testAtomicRmwInt128(.signed);
320320 try testAtomicRmwInt128(.unsigned);
321 comptime try testAtomicRmwInt128(.signed);
322 comptime try testAtomicRmwInt128(.unsigned);
321 try comptime testAtomicRmwInt128(.signed);
322 try comptime testAtomicRmwInt128(.unsigned);
323323}
324324
325325fn testAtomicRmwInt128(comptime signedness: std.builtin.Signedness) !void {
......@@ -441,5 +441,5 @@ test "return @atomicStore, using it as a void value" {
441441 }
442442 };
443443 try S.doTheTest();
444 comptime try S.doTheTest();
444 try comptime S.doTheTest();
445445}
test/behavior/basic.zig+6-6
......@@ -17,7 +17,7 @@ test "empty function with comments" {
1717
1818test "truncate" {
1919 try expect(testTruncate(0x10fd) == 0xfd);
20 comptime try expect(testTruncate(0x10fd) == 0xfd);
20 try comptime expect(testTruncate(0x10fd) == 0xfd);
2121}
2222fn testTruncate(x: u32) u8 {
2323 return @truncate(u8, x);
......@@ -462,7 +462,7 @@ test "struct inside function" {
462462 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
463463
464464 try testStructInFn();
465 comptime try testStructInFn();
465 try comptime testStructInFn();
466466}
467467
468468fn testStructInFn() !void {
......@@ -577,7 +577,7 @@ fn emptyFn() void {}
577577const addr1 = @ptrCast(*const u8, &emptyFn);
578578test "comptime cast fn to ptr" {
579579 const addr2 = @ptrCast(*const u8, &emptyFn);
580 comptime try expect(addr1 == addr2);
580 try comptime expect(addr1 == addr2);
581581}
582582
583583test "equality compare fn ptrs" {
......@@ -688,8 +688,8 @@ test "string concatenation" {
688688 const a = "OK" ++ " IT " ++ "WORKED";
689689 const b = "OK IT WORKED";
690690
691 comptime try expect(@TypeOf(a) == *const [12:0]u8);
692 comptime try expect(@TypeOf(b) == *const [12:0]u8);
691 try comptime expect(@TypeOf(a) == *const [12:0]u8);
692 try comptime expect(@TypeOf(b) == *const [12:0]u8);
693693
694694 const len = b.len;
695695 const len_with_null = len + 1;
......@@ -759,7 +759,7 @@ test "auto created variables have correct alignment" {
759759 }
760760 };
761761 try expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a);
762 comptime try expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a);
762 try comptime expect(S.foo("\x7a\x7a\x7a\x7a") == 0x7a7a7a7a);
763763}
764764
765765test "extern variable with non-pointer opaque type" {
test/behavior/bitcast.zig+12-12
......@@ -14,7 +14,7 @@ test "@bitCast iX -> uX (32, 64)" {
1414
1515 inline for (bit_values) |bits| {
1616 try testBitCast(bits);
17 comptime try testBitCast(bits);
17 try comptime testBitCast(bits);
1818 }
1919}
2020
......@@ -28,7 +28,7 @@ test "@bitCast iX -> uX (8, 16, 128)" {
2828
2929 inline for (bit_values) |bits| {
3030 try testBitCast(bits);
31 comptime try testBitCast(bits);
31 try comptime testBitCast(bits);
3232 }
3333}
3434
......@@ -43,7 +43,7 @@ test "@bitCast iX -> uX exotic integers" {
4343
4444 inline for (bit_values) |bits| {
4545 try testBitCast(bits);
46 comptime try testBitCast(bits);
46 try comptime testBitCast(bits);
4747 }
4848}
4949
......@@ -88,7 +88,7 @@ test "bitcast uX to bytes" {
8888 const bit_values = [_]usize{ 1, 48, 27, 512, 493, 293, 125, 204, 112 };
8989 inline for (bit_values) |bits| {
9090 try testBitCast(bits);
91 comptime try testBitCast(bits);
91 try comptime testBitCast(bits);
9292 }
9393}
9494
......@@ -141,7 +141,7 @@ test "nested bitcast" {
141141 };
142142
143143 try S.foo(42);
144 comptime try S.foo(42);
144 try comptime S.foo(42);
145145}
146146
147147// issue #3010: compiler segfault
......@@ -182,7 +182,7 @@ test "@bitCast packed structs at runtime and comptime" {
182182 }
183183 };
184184 try S.doTheTest();
185 comptime try S.doTheTest();
185 try comptime S.doTheTest();
186186}
187187
188188test "@bitCast extern structs at runtime and comptime" {
......@@ -214,7 +214,7 @@ test "@bitCast extern structs at runtime and comptime" {
214214 }
215215 };
216216 try S.doTheTest();
217 comptime try S.doTheTest();
217 try comptime S.doTheTest();
218218}
219219
220220test "bitcast packed struct to integer and back" {
......@@ -237,7 +237,7 @@ test "bitcast packed struct to integer and back" {
237237 }
238238 };
239239 try S.doTheTest();
240 comptime try S.doTheTest();
240 try comptime S.doTheTest();
241241}
242242
243243test "implicit cast to error union by returning" {
......@@ -254,7 +254,7 @@ test "implicit cast to error union by returning" {
254254 }
255255 };
256256 try S.entry();
257 comptime try S.entry();
257 try comptime S.entry();
258258}
259259
260260test "bitcast packed struct literal to byte" {
......@@ -275,7 +275,7 @@ test "comptime bitcast used in expression has the correct type" {
275275test "bitcast passed as tuple element" {
276276 const S = struct {
277277 fn foo(args: anytype) !void {
278 comptime try expect(@TypeOf(args[0]) == f32);
278 try comptime expect(@TypeOf(args[0]) == f32);
279279 try expect(args[0] == 12.34);
280280 }
281281 };
......@@ -285,7 +285,7 @@ test "bitcast passed as tuple element" {
285285test "triple level result location with bitcast sandwich passed as tuple element" {
286286 const S = struct {
287287 fn foo(args: anytype) !void {
288 comptime try expect(@TypeOf(args[0]) == f64);
288 try comptime expect(@TypeOf(args[0]) == f64);
289289 try expect(args[0] > 12.33 and args[0] < 12.35);
290290 }
291291 };
......@@ -326,7 +326,7 @@ test "@bitCast packed struct of floats" {
326326 }
327327 };
328328 try S.doTheTest();
329 comptime try S.doTheTest();
329 try comptime S.doTheTest();
330330}
331331
332332test "comptime @bitCast packed struct to int and back" {
test/behavior/bitreverse.zig+5-5
......@@ -17,7 +17,7 @@ test "@bitReverse" {
1717 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1818 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1919
20 comptime try testBitReverse();
20 try comptime testBitReverse();
2121 try testBitReverse();
2222}
2323
......@@ -103,7 +103,7 @@ test "bitReverse vectors u8" {
103103 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
104104 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
105105
106 comptime try vector8();
106 try comptime vector8();
107107 try vector8();
108108}
109109
......@@ -122,7 +122,7 @@ test "bitReverse vectors u16" {
122122 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
123123 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
124124
125 comptime try vector16();
125 try comptime vector16();
126126 try vector16();
127127}
128128
......@@ -141,7 +141,7 @@ test "bitReverse vectors u24" {
141141 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
142142 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
143143
144 comptime try vector24();
144 try comptime vector24();
145145 try vector24();
146146}
147147
......@@ -155,6 +155,6 @@ fn vector0() !void {
155155test "bitReverse vectors u0" {
156156 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
157157
158 comptime try vector0();
158 try comptime vector0();
159159 try vector0();
160160}
test/behavior/bool.zig+1-1
......@@ -49,7 +49,7 @@ test "compile time bool not" {
4949
5050test "short circuit" {
5151 try testShortCircuit(false, true);
52 comptime try testShortCircuit(false, true);
52 try comptime testShortCircuit(false, true);
5353}
5454
5555fn testShortCircuit(f: bool, t: bool) !void {
test/behavior/bugs/1076.zig+1-1
......@@ -9,7 +9,7 @@ test "comptime code should not modify constant data" {
99 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1010
1111 try testCastPtrOfArrayToSliceAndPtr();
12 comptime try testCastPtrOfArrayToSliceAndPtr();
12 try comptime testCastPtrOfArrayToSliceAndPtr();
1313}
1414
1515fn testCastPtrOfArrayToSliceAndPtr() !void {
test/behavior/bugs/11139.zig+1-1
......@@ -9,7 +9,7 @@ test "store array of array of structs at comptime" {
99 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1010
1111 try expect(storeArrayOfArrayOfStructs() == 15);
12 comptime try expect(storeArrayOfArrayOfStructs() == 15);
12 try comptime expect(storeArrayOfArrayOfStructs() == 15);
1313}
1414
1515fn storeArrayOfArrayOfStructs() u8 {
test/behavior/bugs/1607.zig+1-1
......@@ -17,5 +17,5 @@ test "slices pointing at the same address as global array." {
1717 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1818
1919 try checkAddress(&a);
20 comptime try checkAddress(&a);
20 try comptime checkAddress(&a);
2121}
test/behavior/bugs/2114.zig+1-1
......@@ -17,7 +17,7 @@ test "fixed" {
1717 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1818
1919 try testCtz();
20 comptime try testCtz();
20 try comptime testCtz();
2121}
2222
2323fn testCtz() !void {
test/behavior/bugs/421.zig+1-1
......@@ -7,7 +7,7 @@ test "bitCast to array" {
77 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
88 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
99
10 comptime try testBitCastArray();
10 try comptime testBitCastArray();
1111 try testBitCastArray();
1212}
1313
test/behavior/bugs/4328.zig+3-3
......@@ -35,7 +35,7 @@ test "Extern function calls in @TypeOf" {
3535 };
3636
3737 try Test.doTheTest();
38 comptime try Test.doTheTest();
38 try comptime Test.doTheTest();
3939}
4040
4141test "Peer resolution of extern function calls in @TypeOf" {
......@@ -52,7 +52,7 @@ test "Peer resolution of extern function calls in @TypeOf" {
5252 };
5353
5454 try Test.doTheTest();
55 comptime try Test.doTheTest();
55 try comptime Test.doTheTest();
5656}
5757
5858test "Extern function calls, dereferences and field access in @TypeOf" {
......@@ -78,5 +78,5 @@ test "Extern function calls, dereferences and field access in @TypeOf" {
7878 };
7979
8080 try Test.doTheTest();
81 comptime try Test.doTheTest();
81 try comptime Test.doTheTest();
8282}
test/behavior/bugs/5474.zig+2-2
......@@ -52,12 +52,12 @@ test "pointer-to-array constness for zero-size elements, var" {
5252 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
5353
5454 try mutable();
55 comptime try mutable();
55 try comptime mutable();
5656}
5757
5858test "pointer-to-array constness for zero-size elements, const" {
5959 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
6060
6161 try constant();
62 comptime try constant();
62 try comptime constant();
6363}
test/behavior/bugs/655.zig+1-1
......@@ -3,7 +3,7 @@ const other_file = @import("655_other_file.zig");
33
44test "function with *const parameter with type dereferenced by namespace" {
55 const x: other_file.Integer = 1234;
6 comptime try std.testing.expect(@TypeOf(&x) == *const other_file.Integer);
6 try comptime std.testing.expect(@TypeOf(&x) == *const other_file.Integer);
77 try foo(&x);
88}
99
test/behavior/byteswap.zig+5-5
......@@ -50,7 +50,7 @@ test "@byteSwap integers" {
5050 try std.testing.expect(expected_output == @byteSwap(input));
5151 }
5252 };
53 comptime try ByteSwapIntTest.run();
53 try comptime ByteSwapIntTest.run();
5454 try ByteSwapIntTest.run();
5555}
5656
......@@ -69,7 +69,7 @@ test "@byteSwap vectors u8" {
6969 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
7070 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
7171
72 comptime try vector8();
72 try comptime vector8();
7373 try vector8();
7474}
7575
......@@ -88,7 +88,7 @@ test "@byteSwap vectors u16" {
8888 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
8989 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
9090
91 comptime try vector16();
91 try comptime vector16();
9292 try vector16();
9393}
9494
......@@ -107,7 +107,7 @@ test "@byteSwap vectors u24" {
107107 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
108108 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
109109
110 comptime try vector24();
110 try comptime vector24();
111111 try vector24();
112112}
113113
......@@ -121,6 +121,6 @@ fn vector0() !void {
121121test "@byteSwap vectors u0" {
122122 if (builtin.zig_backend == .stage2_wasm) return error.SkipZigTest;
123123
124 comptime try vector0();
124 try comptime vector0();
125125 try vector0();
126126}
test/behavior/call.zig+5-5
......@@ -10,11 +10,11 @@ test "super basic invocations" {
1010 }
1111 }.foo;
1212 try expect(@call(.auto, foo, .{}) == 1234);
13 comptime try expect(@call(.always_inline, foo, .{}) == 1234);
13 try comptime expect(@call(.always_inline, foo, .{}) == 1234);
1414 {
1515 // comptime call without comptime keyword
1616 const result = @call(.compile_time, foo, .{}) == 1234;
17 comptime try expect(result);
17 try comptime expect(result);
1818 }
1919}
2020
......@@ -42,7 +42,7 @@ test "basic invocations" {
4242 {
4343 // comptime call without comptime keyword
4444 const result = @call(.compile_time, foo, .{}) == 1234;
45 comptime try expect(result);
45 try comptime expect(result);
4646 }
4747 {
4848 // call of non comptime-known function
......@@ -71,7 +71,7 @@ test "tuple parameters" {
7171 try expect(@call(.auto, add, .{ a, b }) == 46);
7272 try expect(@call(.auto, add, .{ 12, 34 }) == 46);
7373 if (false) {
74 comptime try expect(@call(.auto, add, .{ 12, 34 }) == 46); // TODO
74 try comptime expect(@call(.auto, add, .{ 12, 34 }) == 46); // TODO
7575 }
7676 try expect(comptime @call(.auto, add, .{ 12, 34 }) == 46);
7777 {
......@@ -344,7 +344,7 @@ test "inline call doesn't re-evaluate non generic struct" {
344344 };
345345 const ArgTuple = std.meta.ArgsTuple(@TypeOf(S.foo));
346346 try @call(.always_inline, S.foo, ArgTuple{.{ .a = 123, .b = 45 }});
347 comptime try @call(.always_inline, S.foo, ArgTuple{.{ .a = 123, .b = 45 }});
347 try comptime @call(.always_inline, S.foo, ArgTuple{.{ .a = 123, .b = 45 }});
348348}
349349
350350test "Enum constructed by @Type passed as generic argument" {
test/behavior/cast.zig+58-58
......@@ -39,7 +39,7 @@ fn peerTypeTAndOptionalT(c: bool, b: bool) ?usize {
3939
4040test "resolve undefined with integer" {
4141 try testResolveUndefWithInt(true, 1234);
42 comptime try testResolveUndefWithInt(true, 1234);
42 try comptime testResolveUndefWithInt(true, 1234);
4343}
4444fn testResolveUndefWithInt(b: bool, x: i32) !void {
4545 const value = if (b) x else undefined;
......@@ -59,7 +59,7 @@ test "implicit cast comptime numbers to any type when the value fits" {
5959}
6060
6161test "implicit cast comptime_int to comptime_float" {
62 comptime try expect(@as(comptime_float, 10) == @as(f32, 10));
62 try comptime expect(@as(comptime_float, 10) == @as(f32, 10));
6363 try expect(2 == 2.0);
6464}
6565
......@@ -110,7 +110,7 @@ test "@intToFloat" {
110110 }
111111 };
112112 try S.doTheTest();
113 comptime try S.doTheTest();
113 try comptime S.doTheTest();
114114}
115115
116116test "@intToFloat(f80)" {
......@@ -140,13 +140,13 @@ test "@intToFloat(f80)" {
140140 try S.doTheTest(i80);
141141 try S.doTheTest(i128);
142142 // try S.doTheTest(i256); // TODO missing compiler_rt symbols
143 comptime try S.doTheTest(i31);
144 comptime try S.doTheTest(i32);
145 comptime try S.doTheTest(i45);
146 comptime try S.doTheTest(i64);
147 comptime try S.doTheTest(i80);
148 comptime try S.doTheTest(i128);
149 comptime try S.doTheTest(i256);
143 try comptime S.doTheTest(i31);
144 try comptime S.doTheTest(i32);
145 try comptime S.doTheTest(i45);
146 try comptime S.doTheTest(i64);
147 try comptime S.doTheTest(i80);
148 try comptime S.doTheTest(i128);
149 try comptime S.doTheTest(i256);
150150}
151151
152152test "@floatToInt" {
......@@ -156,7 +156,7 @@ test "@floatToInt" {
156156 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
157157
158158 try testFloatToInts();
159 comptime try testFloatToInts();
159 try comptime testFloatToInts();
160160}
161161
162162fn testFloatToInts() !void {
......@@ -291,7 +291,7 @@ test "@intCast to u0 and use the result" {
291291 }
292292 };
293293 try S.doTheTest(0, 1, 0);
294 comptime try S.doTheTest(0, 1, 0);
294 try comptime S.doTheTest(0, 1, 0);
295295}
296296
297297test "peer result null and comptime_int" {
......@@ -312,11 +312,11 @@ test "peer result null and comptime_int" {
312312 };
313313
314314 try expect(S.blah(0) == null);
315 comptime try expect(S.blah(0) == null);
315 try comptime expect(S.blah(0) == null);
316316 try expect(S.blah(10).? == 1);
317 comptime try expect(S.blah(10).? == 1);
317 try comptime expect(S.blah(10).? == 1);
318318 try expect(S.blah(-10).? == -1);
319 comptime try expect(S.blah(-10).? == -1);
319 try comptime expect(S.blah(-10).? == -1);
320320}
321321
322322test "*const ?[*]const T to [*c]const [*c]const T" {
......@@ -375,7 +375,7 @@ test "return u8 coercing into ?u32 return type" {
375375 }
376376 };
377377 try S.doTheTest();
378 comptime try S.doTheTest();
378 try comptime S.doTheTest();
379379}
380380
381381test "cast from ?[*]T to ??[*]T" {
......@@ -392,7 +392,7 @@ test "peer type unsigned int to signed" {
392392 var x: u8 = 7;
393393 var y: i32 = -5;
394394 var a = w + y + x;
395 comptime try expect(@TypeOf(a) == i32);
395 try comptime expect(@TypeOf(a) == i32);
396396 try expect(a == 7);
397397}
398398
......@@ -414,7 +414,7 @@ test "explicit cast from integer to error type" {
414414 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
415415
416416 try testCastIntToErr(error.ItBroke);
417 comptime try testCastIntToErr(error.ItBroke);
417 try comptime testCastIntToErr(error.ItBroke);
418418}
419419fn testCastIntToErr(err: anyerror) !void {
420420 const x = @errorToInt(err);
......@@ -428,7 +428,7 @@ test "peer resolve array and const slice" {
428428 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
429429
430430 try testPeerResolveArrayConstSlice(true);
431 comptime try testPeerResolveArrayConstSlice(true);
431 try comptime testPeerResolveArrayConstSlice(true);
432432}
433433fn testPeerResolveArrayConstSlice(b: bool) !void {
434434 const value1 = if (b) "aoeu" else @as([]const u8, "zz");
......@@ -444,7 +444,7 @@ test "implicitly cast from T to anyerror!?T" {
444444 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
445445
446446 try castToOptionalTypeError(1);
447 comptime try castToOptionalTypeError(1);
447 try comptime castToOptionalTypeError(1);
448448}
449449
450450const A = struct {
......@@ -470,7 +470,7 @@ test "implicitly cast from [0]T to anyerror![]T" {
470470 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
471471
472472 try testCastZeroArrayToErrSliceMut();
473 comptime try testCastZeroArrayToErrSliceMut();
473 try comptime testCastZeroArrayToErrSliceMut();
474474}
475475
476476fn testCastZeroArrayToErrSliceMut() !void {
......@@ -504,7 +504,7 @@ test "peer type resolution: [0]u8, []const u8, and anyerror![]u8" {
504504 }
505505 };
506506 try S.doTheTest();
507 comptime try S.doTheTest();
507 try comptime S.doTheTest();
508508}
509509fn peerTypeEmptyArrayAndSliceAndError(a: bool, slice: []u8) anyerror![]u8 {
510510 if (a) {
......@@ -520,7 +520,7 @@ test "implicit cast from *const [N]T to []const T" {
520520 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
521521
522522 try testCastConstArrayRefToConstSlice();
523 comptime try testCastConstArrayRefToConstSlice();
523 try comptime testCastConstArrayRefToConstSlice();
524524}
525525
526526fn testCastConstArrayRefToConstSlice() !void {
......@@ -546,9 +546,9 @@ test "peer type resolution: error and [N]T" {
546546 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
547547
548548 try expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK"));
549 comptime try expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK"));
549 try comptime expect(mem.eql(u8, try testPeerErrorAndArray(0), "OK"));
550550 try expect(mem.eql(u8, try testPeerErrorAndArray2(1), "OKK"));
551 comptime try expect(mem.eql(u8, try testPeerErrorAndArray2(1), "OKK"));
551 try comptime expect(mem.eql(u8, try testPeerErrorAndArray2(1), "OKK"));
552552}
553553
554554fn testPeerErrorAndArray(x: u8) anyerror![]const u8 {
......@@ -571,7 +571,7 @@ test "single-item pointer of array to slice to unknown length pointer" {
571571 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
572572
573573 try testCastPtrOfArrayToSliceAndPtr();
574 comptime try testCastPtrOfArrayToSliceAndPtr();
574 try comptime testCastPtrOfArrayToSliceAndPtr();
575575}
576576
577577fn testCastPtrOfArrayToSliceAndPtr() !void {
......@@ -644,9 +644,9 @@ test "vector casts" {
644644 };
645645
646646 try S.doTheTest();
647 comptime try S.doTheTest();
647 try comptime S.doTheTest();
648648 try S.doTheTestFloat();
649 comptime try S.doTheTestFloat();
649 try comptime S.doTheTestFloat();
650650}
651651
652652test "@floatCast cast down" {
......@@ -887,7 +887,7 @@ test "peer resolution of string literals" {
887887 }
888888 };
889889 try S.doTheTest(.b);
890 comptime try S.doTheTest(.b);
890 try comptime S.doTheTest(.b);
891891}
892892
893893test "peer cast [:x]T to []T" {
......@@ -904,7 +904,7 @@ test "peer cast [:x]T to []T" {
904904 }
905905 };
906906 try S.doTheTest();
907 comptime try S.doTheTest();
907 try comptime S.doTheTest();
908908}
909909
910910test "peer cast [N:x]T to [N]T" {
......@@ -920,7 +920,7 @@ test "peer cast [N:x]T to [N]T" {
920920 }
921921 };
922922 try S.doTheTest();
923 comptime try S.doTheTest();
923 try comptime S.doTheTest();
924924}
925925
926926test "peer cast *[N:x]T to *[N]T" {
......@@ -936,7 +936,7 @@ test "peer cast *[N:x]T to *[N]T" {
936936 }
937937 };
938938 try S.doTheTest();
939 comptime try S.doTheTest();
939 try comptime S.doTheTest();
940940}
941941
942942test "peer cast [*:x]T to [*]T" {
......@@ -956,7 +956,7 @@ test "peer cast [*:x]T to [*]T" {
956956 }
957957 };
958958 try S.doTheTest();
959 comptime try S.doTheTest();
959 try comptime S.doTheTest();
960960}
961961
962962test "peer cast [:x]T to [*:x]T" {
......@@ -978,7 +978,7 @@ test "peer cast [:x]T to [*:x]T" {
978978 }
979979 };
980980 try S.doTheTest();
981 comptime try S.doTheTest();
981 try comptime S.doTheTest();
982982}
983983
984984test "peer type resolution implicit cast to return type" {
......@@ -999,7 +999,7 @@ test "peer type resolution implicit cast to return type" {
999999 }
10001000 };
10011001 try S.doTheTest();
1002 comptime try S.doTheTest();
1002 try comptime S.doTheTest();
10031003}
10041004
10051005test "peer type resolution implicit cast to variable type" {
......@@ -1018,7 +1018,7 @@ test "peer type resolution implicit cast to variable type" {
10181018 }
10191019 };
10201020 try S.doTheTest();
1021 comptime try S.doTheTest();
1021 try comptime S.doTheTest();
10221022}
10231023
10241024test "variable initialization uses result locations properly with regards to the type" {
......@@ -1042,7 +1042,7 @@ test "cast between C pointer with different but compatible types" {
10421042 }
10431043 };
10441044 try S.doTheTest();
1045 comptime try S.doTheTest();
1045 try comptime S.doTheTest();
10461046}
10471047
10481048test "peer type resolve string lit with sentinel-terminated mutable slice" {
......@@ -1053,8 +1053,8 @@ test "peer type resolve string lit with sentinel-terminated mutable slice" {
10531053 var array: [4:0]u8 = undefined;
10541054 array[4] = 0; // TODO remove this when #4372 is solved
10551055 var slice: [:0]u8 = array[0..4 :0];
1056 comptime try expect(@TypeOf(slice, "hi") == [:0]const u8);
1057 comptime try expect(@TypeOf("hi", slice) == [:0]const u8);
1056 try comptime expect(@TypeOf(slice, "hi") == [:0]const u8);
1057 try comptime expect(@TypeOf("hi", slice) == [:0]const u8);
10581058}
10591059
10601060test "peer type resolve array pointers, one of them const" {
......@@ -1062,8 +1062,8 @@ test "peer type resolve array pointers, one of them const" {
10621062
10631063 var array1: [4]u8 = undefined;
10641064 const array2: [5]u8 = undefined;
1065 comptime try expect(@TypeOf(&array1, &array2) == []const u8);
1066 comptime try expect(@TypeOf(&array2, &array1) == []const u8);
1065 try comptime expect(@TypeOf(&array1, &array2) == []const u8);
1066 try comptime expect(@TypeOf(&array2, &array1) == []const u8);
10671067}
10681068
10691069test "peer type resolve array pointer and unknown pointer" {
......@@ -1074,17 +1074,17 @@ test "peer type resolve array pointer and unknown pointer" {
10741074 var const_ptr: [*]const u8 = undefined;
10751075 var ptr: [*]u8 = undefined;
10761076
1077 comptime try expect(@TypeOf(&array, ptr) == [*]u8);
1078 comptime try expect(@TypeOf(ptr, &array) == [*]u8);
1077 try comptime expect(@TypeOf(&array, ptr) == [*]u8);
1078 try comptime expect(@TypeOf(ptr, &array) == [*]u8);
10791079
1080 comptime try expect(@TypeOf(&const_array, ptr) == [*]const u8);
1081 comptime try expect(@TypeOf(ptr, &const_array) == [*]const u8);
1080 try comptime expect(@TypeOf(&const_array, ptr) == [*]const u8);
1081 try comptime expect(@TypeOf(ptr, &const_array) == [*]const u8);
10821082
1083 comptime try expect(@TypeOf(&array, const_ptr) == [*]const u8);
1084 comptime try expect(@TypeOf(const_ptr, &array) == [*]const u8);
1083 try comptime expect(@TypeOf(&array, const_ptr) == [*]const u8);
1084 try comptime expect(@TypeOf(const_ptr, &array) == [*]const u8);
10851085
1086 comptime try expect(@TypeOf(&const_array, const_ptr) == [*]const u8);
1087 comptime try expect(@TypeOf(const_ptr, &const_array) == [*]const u8);
1086 try comptime expect(@TypeOf(&const_array, const_ptr) == [*]const u8);
1087 try comptime expect(@TypeOf(const_ptr, &const_array) == [*]const u8);
10881088}
10891089
10901090test "comptime float casts" {
......@@ -1209,7 +1209,7 @@ test "implicitly cast from [N]T to ?[]const T" {
12091209 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
12101210
12111211 try expect(mem.eql(u8, castToOptionalSlice().?, "hi"));
1212 comptime try expect(mem.eql(u8, castToOptionalSlice().?, "hi"));
1212 try comptime expect(mem.eql(u8, castToOptionalSlice().?, "hi"));
12131213}
12141214
12151215fn castToOptionalSlice() ?[]const u8 {
......@@ -1223,7 +1223,7 @@ test "cast u128 to f128 and back" {
12231223 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
12241224 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
12251225
1226 comptime try testCast128();
1226 try comptime testCast128();
12271227 try testCast128();
12281228}
12291229
......@@ -1303,7 +1303,7 @@ test "*const [N]null u8 to ?[]const u8" {
13031303 }
13041304 };
13051305 try S.doTheTest();
1306 comptime try S.doTheTest();
1306 try comptime S.doTheTest();
13071307}
13081308
13091309test "cast between [*c]T and ?[*:0]T on fn parameter" {
......@@ -1352,8 +1352,8 @@ test "peer resolve arrays of different size to const slice" {
13521352
13531353 try expect(mem.eql(u8, boolToStr(true), "true"));
13541354 try expect(mem.eql(u8, boolToStr(false), "false"));
1355 comptime try expect(mem.eql(u8, boolToStr(true), "true"));
1356 comptime try expect(mem.eql(u8, boolToStr(false), "false"));
1355 try comptime expect(mem.eql(u8, boolToStr(true), "true"));
1356 try comptime expect(mem.eql(u8, boolToStr(false), "false"));
13571357}
13581358fn boolToStr(b: bool) []const u8 {
13591359 return if (b) "true" else "false";
......@@ -1376,7 +1376,7 @@ test "cast f16 to wider types" {
13761376 }
13771377 };
13781378 try S.doTheTest();
1379 comptime try S.doTheTest();
1379 try comptime S.doTheTest();
13801380}
13811381
13821382test "cast f128 to narrower types" {
......@@ -1396,7 +1396,7 @@ test "cast f128 to narrower types" {
13961396 }
13971397 };
13981398 try S.doTheTest();
1399 comptime try S.doTheTest();
1399 try comptime S.doTheTest();
14001400}
14011401
14021402test "peer type resolution: unreachable, null, slice" {
......@@ -1436,7 +1436,7 @@ test "cast i8 fn call peers to i32 result" {
14361436 }
14371437 };
14381438 try S.doTheTest();
1439 comptime try S.doTheTest();
1439 try comptime S.doTheTest();
14401440}
14411441
14421442test "cast compatible optional types" {
......@@ -1509,7 +1509,7 @@ test "floatToInt to zero-bit int" {
15091509 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
15101510
15111511 const a: f32 = 0.0;
1512 comptime try std.testing.expect(@floatToInt(u0, a) == 0);
1512 try comptime std.testing.expect(@floatToInt(u0, a) == 0);
15131513}
15141514
15151515test "peer type resolution of function pointer and function body" {
test/behavior/comptime_memory.zig+2-2
......@@ -257,9 +257,9 @@ test "shuffle chunks of linker value" {
257257 try testing.expectEqual(lazy_address, unshuffled1_rt);
258258 const shuffled1_ct = comptime shuffle(lazy_address, Bits, ShuffledBits);
259259 const shuffled1_ct_2 = comptime shuffle(lazy_address, Bits, ShuffledBits);
260 comptime try testing.expectEqual(shuffled1_ct, shuffled1_ct_2);
260 try comptime testing.expectEqual(shuffled1_ct, shuffled1_ct_2);
261261 const unshuffled1_ct = comptime shuffle(shuffled1_ct, ShuffledBits, Bits);
262 comptime try testing.expectEqual(lazy_address, unshuffled1_ct);
262 try comptime testing.expectEqual(lazy_address, unshuffled1_ct);
263263 try testing.expectEqual(shuffled1_ct, shuffled1_rt);
264264}
265265
test/behavior/defer.zig+3-3
......@@ -70,7 +70,7 @@ test "return variable while defer expression in scope to modify it" {
7070 };
7171
7272 try S.doTheTest();
73 comptime try S.doTheTest();
73 try comptime S.doTheTest();
7474}
7575
7676var result: [3]u8 = undefined;
......@@ -131,7 +131,7 @@ test "errdefer with payload" {
131131 }
132132 };
133133 try S.doTheTest();
134 comptime try S.doTheTest();
134 try comptime S.doTheTest();
135135}
136136
137137test "reference to errdefer payload" {
......@@ -157,7 +157,7 @@ test "reference to errdefer payload" {
157157 }
158158 };
159159 try S.doTheTest();
160 comptime try S.doTheTest();
160 try comptime S.doTheTest();
161161}
162162
163163test "simple else prong doesn't emit an error for unreachable else prong" {
test/behavior/enum.zig+16-16
......@@ -611,7 +611,7 @@ test "enum with specified tag values" {
611611 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
612612
613613 try testEnumWithSpecifiedTagValues(MultipleChoice.C);
614 comptime try testEnumWithSpecifiedTagValues(MultipleChoice.C);
614 try comptime testEnumWithSpecifiedTagValues(MultipleChoice.C);
615615}
616616
617617test "non-exhaustive enum" {
......@@ -656,7 +656,7 @@ test "non-exhaustive enum" {
656656 }
657657 };
658658 try S.doTheTest(52);
659 comptime try S.doTheTest(52);
659 try comptime S.doTheTest(52);
660660}
661661
662662test "empty non-exhaustive enum" {
......@@ -677,7 +677,7 @@ test "empty non-exhaustive enum" {
677677 }
678678 };
679679 try S.doTheTest(42);
680 comptime try S.doTheTest(42);
680 try comptime S.doTheTest(42);
681681}
682682
683683test "single field non-exhaustive enum" {
......@@ -715,7 +715,7 @@ test "single field non-exhaustive enum" {
715715 }
716716 };
717717 try S.doTheTest(23);
718 comptime try S.doTheTest(23);
718 try comptime S.doTheTest(23);
719719}
720720
721721const EnumWithTagValues = enum(u4) {
......@@ -750,7 +750,7 @@ test "enum with specified and unspecified tag values" {
750750 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
751751
752752 try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2.D);
753 comptime try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2.D);
753 try comptime testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2.D);
754754}
755755
756756fn testEnumWithSpecifiedAndUnspecifiedTagValues(x: MultipleChoice2) !void {
......@@ -775,18 +775,18 @@ test "set enum tag type" {
775775 {
776776 var x = Small.One;
777777 x = Small.Two;
778 comptime try expect(Tag(Small) == u2);
778 try comptime expect(Tag(Small) == u2);
779779 }
780780 {
781781 var x = Small2.One;
782782 x = Small2.Two;
783 comptime try expect(Tag(Small2) == u2);
783 try comptime expect(Tag(Small2) == u2);
784784 }
785785}
786786
787787test "casting enum to its tag type" {
788788 try testCastEnumTag(Small2.Two);
789 comptime try testCastEnumTag(Small2.Two);
789 try comptime testCastEnumTag(Small2.Two);
790790}
791791
792792fn testCastEnumTag(value: Small2) !void {
......@@ -797,7 +797,7 @@ test "enum with 1 field but explicit tag type should still have the tag type" {
797797 const Enum = enum(u8) {
798798 B = 2,
799799 };
800 comptime try expect(@sizeOf(Enum) == @sizeOf(u8));
800 try comptime expect(@sizeOf(Enum) == @sizeOf(u8));
801801}
802802
803803test "signed integer as enum tag" {
......@@ -836,12 +836,12 @@ test "enum with comptime_int tag type" {
836836 Two = 2,
837837 Three = 1,
838838 };
839 comptime try expect(Tag(Enum) == comptime_int);
839 try comptime expect(Tag(Enum) == comptime_int);
840840}
841841
842842test "enum with one member default to u0 tag type" {
843843 const E0 = enum { X };
844 comptime try expect(Tag(E0) == u0);
844 try comptime expect(Tag(E0) == u0);
845845}
846846
847847const EnumWithOneMember = enum { Eof };
......@@ -891,7 +891,7 @@ test "method call on an enum" {
891891 }
892892 };
893893 try S.doTheTest();
894 comptime try S.doTheTest();
894 try comptime S.doTheTest();
895895}
896896
897897test "enum value allocation" {
......@@ -993,7 +993,7 @@ test "@tagName" {
993993 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
994994
995995 try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));
996 comptime try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));
996 try comptime expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));
997997}
998998
999999fn testEnumTagNameBare(n: anytype) []const u8 {
......@@ -1009,7 +1009,7 @@ test "@tagName non-exhaustive enum" {
10091009 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
10101010
10111011 try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));
1012 comptime try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));
1012 try comptime expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));
10131013}
10141014const NonExhaustive = enum(u8) { A, B, _ };
10151015
......@@ -1047,7 +1047,7 @@ test "@tagName on enum literals" {
10471047 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
10481048
10491049 try expect(mem.eql(u8, @tagName(.FooBar), "FooBar"));
1050 comptime try expect(mem.eql(u8, @tagName(.FooBar), "FooBar"));
1050 try comptime expect(mem.eql(u8, @tagName(.FooBar), "FooBar"));
10511051}
10521052
10531053test "enum literal casting to optional" {
......@@ -1088,7 +1088,7 @@ test "bit field access with enum fields" {
10881088 try expect(getA(&data) == A.Two);
10891089 try expect(getB(&data) == B.Three3);
10901090 try expect(getC(&data) == C.Four4);
1091 comptime try expect(@sizeOf(BitFieldOfEnums) == 1);
1091 try comptime expect(@sizeOf(BitFieldOfEnums) == 1);
10921092
10931093 data.b = B.Four3;
10941094 try expect(data.b == B.Four3);
test/behavior/error.zig+11-11
......@@ -188,7 +188,7 @@ fn bar2() (error{}!void) {}
188188
189189test "error union type " {
190190 try testErrorUnionType();
191 comptime try testErrorUnionType();
191 try comptime testErrorUnionType();
192192}
193193
194194fn testErrorUnionType() !void {
......@@ -201,7 +201,7 @@ fn testErrorUnionType() !void {
201201
202202test "error set type" {
203203 try testErrorSetType();
204 comptime try testErrorSetType();
204 try comptime testErrorSetType();
205205}
206206
207207const MyErrSet = error{
......@@ -227,7 +227,7 @@ test "explicit error set cast" {
227227 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
228228
229229 try testExplicitErrorSetCast(Set1.A);
230 comptime try testExplicitErrorSetCast(Set1.A);
230 try comptime testExplicitErrorSetCast(Set1.A);
231231}
232232
233233const Set1 = error{ A, B };
......@@ -246,7 +246,7 @@ test "comptime test error for empty error set" {
246246 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
247247
248248 try testComptimeTestErrorEmptySet(1234);
249 comptime try testComptimeTestErrorEmptySet(1234);
249 try comptime testComptimeTestErrorEmptySet(1234);
250250}
251251
252252const EmptyErrorSet = error{};
......@@ -337,7 +337,7 @@ test "error: Zero sized error set returned with value payload crash" {
337337 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
338338
339339 _ = try foo3(0);
340 _ = comptime try foo3(0);
340 _ = try comptime foo3(0);
341341}
342342
343343const Error = error{};
......@@ -446,7 +446,7 @@ test "return function call to error set from error union function" {
446446 }
447447 };
448448 try expectError(error.Failure, S.errorable());
449 comptime try expectError(error.Failure, S.errorable());
449 try comptime expectError(error.Failure, S.errorable());
450450}
451451
452452test "optional error set is the same size as error set" {
......@@ -455,15 +455,15 @@ test "optional error set is the same size as error set" {
455455 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
456456 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
457457
458 comptime try expect(@sizeOf(?anyerror) == @sizeOf(anyerror));
459 comptime try expect(@alignOf(?anyerror) == @alignOf(anyerror));
458 try comptime expect(@sizeOf(?anyerror) == @sizeOf(anyerror));
459 try comptime expect(@alignOf(?anyerror) == @alignOf(anyerror));
460460 const S = struct {
461461 fn returnsOptErrSet() ?anyerror {
462462 return null;
463463 }
464464 };
465465 try expect(S.returnsOptErrSet() == null);
466 comptime try expect(S.returnsOptErrSet() == null);
466 try comptime expect(S.returnsOptErrSet() == null);
467467}
468468
469469test "nested catch" {
......@@ -489,7 +489,7 @@ test "nested catch" {
489489 };
490490 };
491491 try S.entry();
492 comptime try S.entry();
492 try comptime S.entry();
493493}
494494
495495test "function pointer with return type that is error union with payload which is pointer of parent struct" {
......@@ -545,7 +545,7 @@ test "return result loc as peer result loc in inferred error set function" {
545545 }
546546 };
547547 try S.doTheTest();
548 comptime try S.doTheTest();
548 try comptime S.doTheTest();
549549}
550550
551551test "error payload type is correctly resolved" {
test/behavior/eval.zig+10-10
......@@ -56,7 +56,7 @@ fn staticAdd(a: i32, b: i32) i32 {
5656
5757test "const expr eval on single expr blocks" {
5858 try expect(constExprEvalOnSingleExprBlocksFn(1, true) == 3);
59 comptime try expect(constExprEvalOnSingleExprBlocksFn(1, true) == 3);
59 try comptime expect(constExprEvalOnSingleExprBlocksFn(1, true) == 3);
6060}
6161
6262fn constExprEvalOnSingleExprBlocksFn(x: i32, b: bool) i32 {
......@@ -436,7 +436,7 @@ test "f64 at compile time is lossy" {
436436}
437437
438438test {
439 comptime try expect(@as(f128, 1 << 113) == 10384593717069655257060992658440192);
439 try comptime expect(@as(f128, 1 << 113) == 10384593717069655257060992658440192);
440440}
441441
442442fn copyWithPartialInline(s: []u32, b: []u8) void {
......@@ -625,7 +625,7 @@ test "const global shares pointer with other same one" {
625625 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
626626
627627 try assertEqualPtrs(&hi1[0], &hi2[0]);
628 comptime try expect(&hi1[0] == &hi2[0]);
628 try comptime expect(&hi1[0] == &hi2[0]);
629629}
630630fn assertEqualPtrs(ptr1: *const u8, ptr2: *const u8) !void {
631631 try expect(ptr1 == ptr2);
......@@ -646,8 +646,8 @@ fn assertEqualPtrs(ptr1: *const u8, ptr2: *const u8) !void {
646646test "string literal used as comptime slice is memoized" {
647647 const a = "link";
648648 const b = "link";
649 comptime try expect(TypeWithCompTimeSlice(a).Node == TypeWithCompTimeSlice(b).Node);
650 comptime try expect(TypeWithCompTimeSlice("link").Node == TypeWithCompTimeSlice("link").Node);
649 try comptime expect(TypeWithCompTimeSlice(a).Node == TypeWithCompTimeSlice(b).Node);
650 try comptime expect(TypeWithCompTimeSlice("link").Node == TypeWithCompTimeSlice("link").Node);
651651}
652652
653653pub fn TypeWithCompTimeSlice(comptime field_name: []const u8) type {
......@@ -1072,7 +1072,7 @@ test "comptime break operand passing through runtime condition converted to runt
10721072 };
10731073
10741074 try S.doTheTest('b');
1075 comptime try S.doTheTest('b');
1075 try comptime S.doTheTest('b');
10761076}
10771077
10781078test "comptime break operand passing through runtime switch converted to runtime break" {
......@@ -1092,7 +1092,7 @@ test "comptime break operand passing through runtime switch converted to runtime
10921092 };
10931093
10941094 try S.doTheTest('b');
1095 comptime try S.doTheTest('b');
1095 try comptime S.doTheTest('b');
10961096}
10971097
10981098test "no dependency loop for alignment of self struct" {
......@@ -1349,7 +1349,7 @@ test "value in if block is comptime-known" {
13491349 const s = if (false) S{ .str = "a" } else S{ .str = "b" };
13501350 break :blk "foo" ++ s.str;
13511351 };
1352 comptime try expect(std.mem.eql(u8, first, second));
1352 try comptime expect(std.mem.eql(u8, first, second));
13531353}
13541354
13551355test "lazy sizeof is resolved in division" {
......@@ -1448,7 +1448,7 @@ test "length of global array is determinable at comptime" {
14481448 try std.testing.expect(bytes.len == 1024);
14491449 }
14501450 };
1451 comptime try S.foo();
1451 try comptime S.foo();
14521452}
14531453
14541454test "continue nested inline for loop" {
......@@ -1574,7 +1574,7 @@ test "comptime function turns function value to function pointer" {
15741574 fnPtr(Nil),
15751575 };
15761576 };
1577 comptime try expect(S.foo[0] == &S.Nil);
1577 try comptime expect(S.foo[0] == &S.Nil);
15781578}
15791579
15801580test "container level const and var have unique addresses" {
test/behavior/field_parent_ptr.zig+5-5
......@@ -7,7 +7,7 @@ test "@fieldParentPtr non-first field" {
77 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
88
99 try testParentFieldPtr(&foo.c);
10 comptime try testParentFieldPtr(&foo.c);
10 try comptime testParentFieldPtr(&foo.c);
1111}
1212
1313test "@fieldParentPtr first field" {
......@@ -16,7 +16,7 @@ test "@fieldParentPtr first field" {
1616 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1717
1818 try testParentFieldPtrFirst(&foo.a);
19 comptime try testParentFieldPtrFirst(&foo.a);
19 try comptime testParentFieldPtrFirst(&foo.a);
2020}
2121
2222const Foo = struct {
......@@ -56,7 +56,7 @@ test "@fieldParentPtr untagged union" {
5656 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
5757
5858 try testFieldParentPtrUnion(&bar.c);
59 comptime try testFieldParentPtrUnion(&bar.c);
59 try comptime testFieldParentPtrUnion(&bar.c);
6060}
6161
6262const Bar = union(enum) {
......@@ -83,7 +83,7 @@ test "@fieldParentPtr tagged union" {
8383 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
8484
8585 try testFieldParentPtrTaggedUnion(&bar_tagged.c);
86 comptime try testFieldParentPtrTaggedUnion(&bar_tagged.c);
86 try comptime testFieldParentPtrTaggedUnion(&bar_tagged.c);
8787}
8888
8989const BarTagged = union(enum) {
......@@ -110,7 +110,7 @@ test "@fieldParentPtr extern union" {
110110 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
111111
112112 try testFieldParentPtrExternUnion(&bar_extern.c);
113 comptime try testFieldParentPtrExternUnion(&bar_extern.c);
113 try comptime testFieldParentPtrExternUnion(&bar_extern.c);
114114}
115115
116116const BarExtern = extern union {
test/behavior/floatop.zig+58-58
......@@ -25,7 +25,7 @@ test "floating point comparisons" {
2525 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
2626
2727 try testFloatComparisons();
28 comptime try testFloatComparisons();
28 try comptime testFloatComparisons();
2929}
3030
3131fn testFloatComparisons() !void {
......@@ -61,7 +61,7 @@ test "different sized float comparisons" {
6161 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
6262
6363 try testDifferentSizedFloatComparisons();
64 comptime try testDifferentSizedFloatComparisons();
64 try comptime testDifferentSizedFloatComparisons();
6565}
6666
6767fn testDifferentSizedFloatComparisons() !void {
......@@ -104,7 +104,7 @@ test "@sqrt" {
104104 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
105105 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
106106
107 comptime try testSqrt();
107 try comptime testSqrt();
108108 try testSqrt();
109109}
110110
......@@ -142,7 +142,7 @@ test "@sqrt with vectors" {
142142 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
143143 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
144144
145 comptime try testSqrtWithVectors();
145 try comptime testSqrtWithVectors();
146146 try testSqrtWithVectors();
147147}
148148
......@@ -188,18 +188,18 @@ test "another, possibly redundant @sqrt test" {
188188 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
189189
190190 try testSqrtLegacy(f64, 12.0);
191 comptime try testSqrtLegacy(f64, 12.0);
191 try comptime testSqrtLegacy(f64, 12.0);
192192 try testSqrtLegacy(f32, 13.0);
193 comptime try testSqrtLegacy(f32, 13.0);
193 try comptime testSqrtLegacy(f32, 13.0);
194194 try testSqrtLegacy(f16, 13.0);
195 comptime try testSqrtLegacy(f16, 13.0);
195 try comptime testSqrtLegacy(f16, 13.0);
196196
197197 // TODO: make this pass
198198 if (false) {
199199 const x = 14.0;
200200 const y = x * x;
201201 const z = @sqrt(y);
202 comptime try expect(z == x);
202 try comptime expect(z == x);
203203 }
204204}
205205
......@@ -214,7 +214,7 @@ test "@sin" {
214214 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
215215 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
216216
217 comptime try testSin();
217 try comptime testSin();
218218 try testSin();
219219}
220220
......@@ -235,7 +235,7 @@ test "@sin with vectors" {
235235 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
236236 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
237237
238 comptime try testSinWithVectors();
238 try comptime testSinWithVectors();
239239 try testSinWithVectors();
240240}
241241
......@@ -255,7 +255,7 @@ test "@cos" {
255255 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
256256 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
257257
258 comptime try testCos();
258 try comptime testCos();
259259 try testCos();
260260}
261261
......@@ -276,7 +276,7 @@ test "@cos with vectors" {
276276 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
277277 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
278278
279 comptime try testCosWithVectors();
279 try comptime testCosWithVectors();
280280 try testCosWithVectors();
281281}
282282
......@@ -296,7 +296,7 @@ test "@exp" {
296296 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
297297 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
298298
299 comptime try testExp();
299 try comptime testExp();
300300 try testExp();
301301}
302302
......@@ -316,7 +316,7 @@ test "@exp with vectors" {
316316 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
317317 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
318318
319 comptime try testExpWithVectors();
319 try comptime testExpWithVectors();
320320 try testExpWithVectors();
321321}
322322
......@@ -336,7 +336,7 @@ test "@exp2" {
336336 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
337337 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
338338
339 comptime try testExp2();
339 try comptime testExp2();
340340 try testExp2();
341341}
342342
......@@ -356,7 +356,7 @@ test "@exp2 with @vectors" {
356356 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
357357 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
358358
359 comptime try testExp2WithVectors();
359 try comptime testExp2WithVectors();
360360 try testExp2WithVectors();
361361}
362362
......@@ -376,7 +376,7 @@ test "@log" {
376376 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
377377 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
378378
379 comptime try testLog();
379 try comptime testLog();
380380 try testLog();
381381}
382382
......@@ -425,7 +425,7 @@ test "@log2" {
425425 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
426426 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
427427
428 comptime try testLog2();
428 try comptime testLog2();
429429 try testLog2();
430430}
431431
......@@ -449,7 +449,7 @@ test "@log2 with vectors" {
449449 builtin.cpu.arch == .aarch64 and
450450 builtin.os.tag == .windows) return error.SkipZigTest;
451451
452 comptime try testLog2WithVectors();
452 try comptime testLog2WithVectors();
453453 try testLog2WithVectors();
454454}
455455
......@@ -469,7 +469,7 @@ test "@log10" {
469469 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
470470 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
471471
472 comptime try testLog10();
472 try comptime testLog10();
473473 try testLog10();
474474}
475475
......@@ -489,7 +489,7 @@ test "@log10 with vectors" {
489489 if (builtin.zig_backend == .stage2_arm) return error.SkipZigTest; // TODO
490490 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
491491
492 comptime try testLog10WithVectors();
492 try comptime testLog10WithVectors();
493493 try testLog10WithVectors();
494494}
495495
......@@ -507,7 +507,7 @@ test "@fabs" {
507507 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
508508 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
509509
510 comptime try testFabs();
510 try comptime testFabs();
511511 try testFabs();
512512}
513513
......@@ -535,7 +535,7 @@ test "@fabs with vectors" {
535535 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
536536 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
537537
538 comptime try testFabsWithVectors();
538 try comptime testFabsWithVectors();
539539 try testFabsWithVectors();
540540}
541541
......@@ -556,18 +556,18 @@ test "another, possibly redundant, @fabs test" {
556556 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
557557
558558 try testFabsLegacy(f128, 12.0);
559 comptime try testFabsLegacy(f128, 12.0);
559 try comptime testFabsLegacy(f128, 12.0);
560560 try testFabsLegacy(f64, 12.0);
561 comptime try testFabsLegacy(f64, 12.0);
561 try comptime testFabsLegacy(f64, 12.0);
562562 try testFabsLegacy(f32, 12.0);
563 comptime try testFabsLegacy(f32, 12.0);
563 try comptime testFabsLegacy(f32, 12.0);
564564 try testFabsLegacy(f16, 12.0);
565 comptime try testFabsLegacy(f16, 12.0);
565 try comptime testFabsLegacy(f16, 12.0);
566566
567567 const x = 14.0;
568568 const y = -x;
569569 const z = @fabs(y);
570 comptime try std.testing.expectEqual(x, z);
570 try comptime std.testing.expectEqual(x, z);
571571}
572572
573573test "@fabs f80" {
......@@ -578,7 +578,7 @@ test "@fabs f80" {
578578 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
579579
580580 try testFabsLegacy(f80, 12.0);
581 comptime try testFabsLegacy(f80, 12.0);
581 try comptime testFabsLegacy(f80, 12.0);
582582}
583583
584584fn testFabsLegacy(comptime T: type, x: T) !void {
......@@ -621,7 +621,7 @@ test "@floor" {
621621 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
622622 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
623623
624 comptime try testFloor();
624 try comptime testFloor();
625625 try testFloor();
626626}
627627
......@@ -646,7 +646,7 @@ test "@floor with vectors" {
646646 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
647647 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
648648
649 comptime try testFloorWithVectors();
649 try comptime testFloorWithVectors();
650650 try testFloorWithVectors();
651651}
652652
......@@ -666,16 +666,16 @@ test "another, possibly redundant, @floor test" {
666666 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
667667
668668 try testFloorLegacy(f64, 12.0);
669 comptime try testFloorLegacy(f64, 12.0);
669 try comptime testFloorLegacy(f64, 12.0);
670670 try testFloorLegacy(f32, 12.0);
671 comptime try testFloorLegacy(f32, 12.0);
671 try comptime testFloorLegacy(f32, 12.0);
672672 try testFloorLegacy(f16, 12.0);
673 comptime try testFloorLegacy(f16, 12.0);
673 try comptime testFloorLegacy(f16, 12.0);
674674
675675 const x = 14.0;
676676 const y = x + 0.7;
677677 const z = @floor(y);
678 comptime try expect(x == z);
678 try comptime expect(x == z);
679679}
680680
681681test "@floor f80" {
......@@ -691,7 +691,7 @@ test "@floor f80" {
691691 }
692692
693693 try testFloorLegacy(f80, 12.0);
694 comptime try testFloorLegacy(f80, 12.0);
694 try comptime testFloorLegacy(f80, 12.0);
695695}
696696
697697test "@floor f128" {
......@@ -702,7 +702,7 @@ test "@floor f128" {
702702 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
703703
704704 try testFloorLegacy(f128, 12.0);
705 comptime try testFloorLegacy(f128, 12.0);
705 try comptime testFloorLegacy(f128, 12.0);
706706}
707707
708708fn testFloorLegacy(comptime T: type, x: T) !void {
......@@ -717,7 +717,7 @@ test "@ceil" {
717717 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
718718 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
719719
720 comptime try testCeil();
720 try comptime testCeil();
721721 try testCeil();
722722}
723723
......@@ -742,7 +742,7 @@ test "@ceil with vectors" {
742742 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
743743 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
744744
745 comptime try testCeilWithVectors();
745 try comptime testCeilWithVectors();
746746 try testCeilWithVectors();
747747}
748748
......@@ -762,16 +762,16 @@ test "another, possibly redundant, @ceil test" {
762762 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
763763
764764 try testCeilLegacy(f64, 12.0);
765 comptime try testCeilLegacy(f64, 12.0);
765 try comptime testCeilLegacy(f64, 12.0);
766766 try testCeilLegacy(f32, 12.0);
767 comptime try testCeilLegacy(f32, 12.0);
767 try comptime testCeilLegacy(f32, 12.0);
768768 try testCeilLegacy(f16, 12.0);
769 comptime try testCeilLegacy(f16, 12.0);
769 try comptime testCeilLegacy(f16, 12.0);
770770
771771 const x = 14.0;
772772 const y = x - 0.7;
773773 const z = @ceil(y);
774 comptime try expect(x == z);
774 try comptime expect(x == z);
775775}
776776
777777test "@ceil f80" {
......@@ -787,7 +787,7 @@ test "@ceil f80" {
787787 }
788788
789789 try testCeilLegacy(f80, 12.0);
790 comptime try testCeilLegacy(f80, 12.0);
790 try comptime testCeilLegacy(f80, 12.0);
791791}
792792
793793test "@ceil f128" {
......@@ -798,7 +798,7 @@ test "@ceil f128" {
798798 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
799799
800800 try testCeilLegacy(f128, 12.0);
801 comptime try testCeilLegacy(f128, 12.0);
801 try comptime testCeilLegacy(f128, 12.0);
802802}
803803
804804fn testCeilLegacy(comptime T: type, x: T) !void {
......@@ -812,7 +812,7 @@ test "@trunc" {
812812 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
813813 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
814814
815 comptime try testTrunc();
815 try comptime testTrunc();
816816 try testTrunc();
817817}
818818
......@@ -837,7 +837,7 @@ test "@trunc with vectors" {
837837 if (builtin.zig_backend == .stage2_aarch64) return error.SkipZigTest; // TODO
838838 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
839839
840 comptime try testTruncWithVectors();
840 try comptime testTruncWithVectors();
841841 try testTruncWithVectors();
842842}
843843
......@@ -857,16 +857,16 @@ test "another, possibly redundant, @trunc test" {
857857 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
858858
859859 try testTruncLegacy(f64, 12.0);
860 comptime try testTruncLegacy(f64, 12.0);
860 try comptime testTruncLegacy(f64, 12.0);
861861 try testTruncLegacy(f32, 12.0);
862 comptime try testTruncLegacy(f32, 12.0);
862 try comptime testTruncLegacy(f32, 12.0);
863863 try testTruncLegacy(f16, 12.0);
864 comptime try testTruncLegacy(f16, 12.0);
864 try comptime testTruncLegacy(f16, 12.0);
865865
866866 const x = 14.0;
867867 const y = x + 0.7;
868868 const z = @trunc(y);
869 comptime try expect(x == z);
869 try comptime expect(x == z);
870870}
871871
872872test "@trunc f80" {
......@@ -882,7 +882,7 @@ test "@trunc f80" {
882882 }
883883
884884 try testTruncLegacy(f80, 12.0);
885 comptime try testTruncLegacy(f80, 12.0);
885 try comptime testTruncLegacy(f80, 12.0);
886886 comptime {
887887 const x: f80 = 12.0;
888888 const y = x + 0.8;
......@@ -899,7 +899,7 @@ test "@trunc f128" {
899899 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
900900
901901 try testTruncLegacy(f128, 12.0);
902 comptime try testTruncLegacy(f128, 12.0);
902 try comptime testTruncLegacy(f128, 12.0);
903903}
904904
905905fn testTruncLegacy(comptime T: type, x: T) !void {
......@@ -939,7 +939,7 @@ test "negation f16" {
939939 };
940940
941941 try S.doTheTest();
942 comptime try S.doTheTest();
942 try comptime S.doTheTest();
943943}
944944
945945test "negation f32" {
......@@ -959,7 +959,7 @@ test "negation f32" {
959959 };
960960
961961 try S.doTheTest();
962 comptime try S.doTheTest();
962 try comptime S.doTheTest();
963963}
964964
965965test "negation f64" {
......@@ -979,7 +979,7 @@ test "negation f64" {
979979 };
980980
981981 try S.doTheTest();
982 comptime try S.doTheTest();
982 try comptime S.doTheTest();
983983}
984984
985985test "negation f80" {
......@@ -1001,7 +1001,7 @@ test "negation f80" {
10011001 };
10021002
10031003 try S.doTheTest();
1004 comptime try S.doTheTest();
1004 try comptime S.doTheTest();
10051005}
10061006
10071007test "negation f128" {
......@@ -1023,7 +1023,7 @@ test "negation f128" {
10231023 };
10241024
10251025 try S.doTheTest();
1026 comptime try S.doTheTest();
1026 try comptime S.doTheTest();
10271027}
10281028
10291029test "eval @setFloatMode at compile-time" {
test/behavior/fn.zig+6-6
......@@ -211,7 +211,7 @@ test "pass by non-copying value through var arg" {
211211}
212212
213213fn addPointCoordsVar(pt: anytype) !i32 {
214 comptime try expect(@TypeOf(pt) == Point);
214 try comptime expect(@TypeOf(pt) == Point);
215215 return pt.x + pt.y;
216216}
217217
......@@ -285,7 +285,7 @@ test "implicit cast fn call result to optional in field result" {
285285 };
286286 };
287287 try S.entry();
288 comptime try S.entry();
288 try comptime S.entry();
289289}
290290
291291test "void parameters" {
......@@ -344,7 +344,7 @@ fn fn4() u32 {
344344
345345test "number literal as an argument" {
346346 try numberLiteralArg(3);
347 comptime try numberLiteralArg(3);
347 try comptime numberLiteralArg(3);
348348}
349349
350350fn numberLiteralArg(a: anytype) !void {
......@@ -369,7 +369,7 @@ test "function call with anon list literal" {
369369 }
370370 };
371371 try S.doTheTest();
372 comptime try S.doTheTest();
372 try comptime S.doTheTest();
373373}
374374
375375test "function call with anon list literal - 2D" {
......@@ -391,7 +391,7 @@ test "function call with anon list literal - 2D" {
391391 }
392392 };
393393 try S.doTheTest();
394 comptime try S.doTheTest();
394 try comptime S.doTheTest();
395395}
396396
397397test "ability to give comptime types and non comptime types to same parameter" {
......@@ -410,7 +410,7 @@ test "ability to give comptime types and non comptime types to same parameter" {
410410 }
411411 };
412412 try S.doTheTest();
413 comptime try S.doTheTest();
413 try comptime S.doTheTest();
414414}
415415
416416test "function with inferred error set but returning no error" {
test/behavior/for.zig+6-6
......@@ -23,7 +23,7 @@ test "continue in for loop" {
2323
2424test "break from outer for loop" {
2525 try testBreakOuter();
26 comptime try testBreakOuter();
26 try comptime testBreakOuter();
2727}
2828
2929fn testBreakOuter() !void {
......@@ -40,7 +40,7 @@ fn testBreakOuter() !void {
4040
4141test "continue outer for loop" {
4242 try testContinueOuter();
43 comptime try testContinueOuter();
43 try comptime testContinueOuter();
4444}
4545
4646fn testContinueOuter() !void {
......@@ -129,7 +129,7 @@ test "for with null and T peer types and inferred result location type" {
129129 }
130130 };
131131 try S.doTheTest(&[_]u8{ 1, 2 });
132 comptime try S.doTheTest(&[_]u8{ 1, 2 });
132 try comptime S.doTheTest(&[_]u8{ 1, 2 });
133133}
134134
135135test "2 break statements and an else" {
......@@ -150,7 +150,7 @@ test "2 break statements and an else" {
150150 }
151151 };
152152 try S.entry(true, false);
153 comptime try S.entry(true, false);
153 try comptime S.entry(true, false);
154154}
155155
156156test "for loop with pointer elem var" {
......@@ -197,7 +197,7 @@ test "for copies its payload" {
197197 }
198198 };
199199 try S.doTheTest();
200 comptime try S.doTheTest();
200 try comptime S.doTheTest();
201201}
202202
203203test "for on slice with allowzero ptr" {
......@@ -214,7 +214,7 @@ test "for on slice with allowzero ptr" {
214214 }
215215 };
216216 try S.doTheTest(&[_]u8{ 1, 2, 3, 4 });
217 comptime try S.doTheTest(&[_]u8{ 1, 2, 3, 4 });
217 try comptime S.doTheTest(&[_]u8{ 1, 2, 3, 4 });
218218}
219219
220220test "else continue outer for" {
test/behavior/if.zig+2-2
......@@ -93,7 +93,7 @@ test "if copies its payload" {
9393 }
9494 };
9595 try S.doTheTest();
96 comptime try S.doTheTest();
96 try comptime S.doTheTest();
9797}
9898
9999test "if prongs cast to expected type instead of peer type resolution" {
......@@ -109,7 +109,7 @@ test "if prongs cast to expected type instead of peer type resolution" {
109109 }
110110 };
111111 try S.doTheTest(false);
112 comptime try S.doTheTest(false);
112 try comptime S.doTheTest(false);
113113}
114114
115115test "if peer expressions inferred optional type" {
test/behavior/int128.zig+4-4
......@@ -95,16 +95,16 @@ test "shift int128" {
9595 const types = .{ u128, i128 };
9696 inline for (types) |t| {
9797 try testShlTrunc(t, 0x8, 123);
98 comptime try testShlTrunc(t, 0x8, 123);
98 try comptime testShlTrunc(t, 0x8, 123);
9999
100100 try testShlTrunc(t, 0x40000000_00000000, 64);
101 comptime try testShlTrunc(t, 0x40000000_00000000, 64);
101 try comptime testShlTrunc(t, 0x40000000_00000000, 64);
102102
103103 try testShlTrunc(t, 0x01000000_00000000_00000000, 38);
104 comptime try testShlTrunc(t, 0x01000000_00000000_00000000, 38);
104 try comptime testShlTrunc(t, 0x01000000_00000000_00000000, 38);
105105
106106 try testShlTrunc(t, 0x00000008_00000000_00000000_00000000, 27);
107 comptime try testShlTrunc(t, 0x00000008_00000000_00000000_00000000, 27);
107 try comptime testShlTrunc(t, 0x00000008_00000000_00000000_00000000, 27);
108108 }
109109}
110110
test/behavior/int_div.zig+1-1
......@@ -9,7 +9,7 @@ test "integer division" {
99 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1010
1111 try testDivision();
12 comptime try testDivision();
12 try comptime testDivision();
1313}
1414fn testDivision() !void {
1515 try expect(div(u32, 13, 3) == 4);
test/behavior/math.zig+53-53
......@@ -40,7 +40,7 @@ test "assignment operators" {
4040
4141test "three expr in a row" {
4242 try testThreeExprInARow(false, true);
43 comptime try testThreeExprInARow(false, true);
43 try comptime testThreeExprInARow(false, true);
4444}
4545fn testThreeExprInARow(f: bool, t: bool) !void {
4646 try assertFalse(f or f or f);
......@@ -67,7 +67,7 @@ test "@clz" {
6767 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
6868
6969 try testClz();
70 comptime try testClz();
70 try comptime testClz();
7171}
7272
7373fn testClz() !void {
......@@ -86,7 +86,7 @@ test "@clz big ints" {
8686 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
8787
8888 try testClzBigInts();
89 comptime try testClzBigInts();
89 try comptime testClzBigInts();
9090}
9191
9292fn testClzBigInts() !void {
......@@ -107,7 +107,7 @@ test "@clz vectors" {
107107 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
108108
109109 try testClzVectors();
110 comptime try testClzVectors();
110 try comptime testClzVectors();
111111}
112112
113113fn testClzVectors() !void {
......@@ -147,7 +147,7 @@ test "@ctz" {
147147 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
148148
149149 try testCtz();
150 comptime try testCtz();
150 try comptime testCtz();
151151}
152152
153153fn testCtz() !void {
......@@ -176,7 +176,7 @@ test "@ctz vectors" {
176176 }
177177
178178 try testCtzVectors();
179 comptime try testCtzVectors();
179 try comptime testCtzVectors();
180180}
181181
182182fn testCtzVectors() !void {
......@@ -213,7 +213,7 @@ test "float equality" {
213213 const y: f64 = x + 1.0;
214214
215215 try testFloatEqualityImpl(x, y);
216 comptime try testFloatEqualityImpl(x, y);
216 try comptime testFloatEqualityImpl(x, y);
217217}
218218
219219fn testFloatEqualityImpl(x: f64, y: f64) !void {
......@@ -222,7 +222,7 @@ fn testFloatEqualityImpl(x: f64, y: f64) !void {
222222}
223223
224224test "hex float literal parsing" {
225 comptime try expect(0x1.0 == 1.0);
225 try comptime expect(0x1.0 == 1.0);
226226}
227227
228228test "hex float literal within range" {
......@@ -323,7 +323,7 @@ test "comptime_int multi-limb partial shift right" {
323323
324324test "xor" {
325325 try test_xor();
326 comptime try test_xor();
326 try comptime test_xor();
327327}
328328
329329fn test_xor() !void {
......@@ -412,7 +412,7 @@ test "division" {
412412 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
413413
414414 try testDivision();
415 comptime try testDivision();
415 try comptime testDivision();
416416}
417417
418418fn testDivision() !void {
......@@ -492,7 +492,7 @@ test "division half-precision floats" {
492492 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
493493
494494 try testDivisionFP16();
495 comptime try testDivisionFP16();
495 try comptime testDivisionFP16();
496496}
497497
498498fn testDivisionFP16() !void {
......@@ -527,7 +527,7 @@ fn mod(comptime T: type, a: T, b: T) T {
527527
528528test "unsigned wrapping" {
529529 try testUnsignedWrappingEval(maxInt(u32));
530 comptime try testUnsignedWrappingEval(maxInt(u32));
530 try comptime testUnsignedWrappingEval(maxInt(u32));
531531}
532532fn testUnsignedWrappingEval(x: u32) !void {
533533 const zero = x +% 1;
......@@ -538,7 +538,7 @@ fn testUnsignedWrappingEval(x: u32) !void {
538538
539539test "signed wrapping" {
540540 try testSignedWrappingEval(maxInt(i32));
541 comptime try testSignedWrappingEval(maxInt(i32));
541 try comptime testSignedWrappingEval(maxInt(i32));
542542}
543543fn testSignedWrappingEval(x: i32) !void {
544544 const min_val = x +% 1;
......@@ -549,7 +549,7 @@ fn testSignedWrappingEval(x: i32) !void {
549549
550550test "signed negation wrapping" {
551551 try testSignedNegationWrappingEval(minInt(i16));
552 comptime try testSignedNegationWrappingEval(minInt(i16));
552 try comptime testSignedNegationWrappingEval(minInt(i16));
553553}
554554fn testSignedNegationWrappingEval(x: i16) !void {
555555 try expect(x == -32768);
......@@ -559,7 +559,7 @@ fn testSignedNegationWrappingEval(x: i16) !void {
559559
560560test "unsigned negation wrapping" {
561561 try testUnsignedNegationWrappingEval(1);
562 comptime try testUnsignedNegationWrappingEval(1);
562 try comptime testUnsignedNegationWrappingEval(1);
563563}
564564fn testUnsignedNegationWrappingEval(x: u16) !void {
565565 try expect(x == 1);
......@@ -586,7 +586,7 @@ test "unsigned 64-bit division" {
586586 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
587587
588588 try test_u64_div();
589 comptime try test_u64_div();
589 try comptime test_u64_div();
590590}
591591fn test_u64_div() !void {
592592 const result = divWithResult(1152921504606846976, 34359738365);
......@@ -614,7 +614,7 @@ test "truncating shift right" {
614614 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
615615
616616 try testShrTrunc(maxInt(u16));
617 comptime try testShrTrunc(maxInt(u16));
617 try comptime testShrTrunc(maxInt(u16));
618618}
619619fn testShrTrunc(x: u16) !void {
620620 const shifted = x >> 1;
......@@ -630,7 +630,7 @@ test "f128" {
630630 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
631631
632632 try test_f128();
633 comptime try test_f128();
633 try comptime test_f128();
634634}
635635
636636fn make_f128(x: f128) f128 {
......@@ -1238,12 +1238,12 @@ test "quad hex float literal parsing accurate" {
12381238 }
12391239 };
12401240 try S.doTheTest();
1241 comptime try S.doTheTest();
1241 try comptime S.doTheTest();
12421242}
12431243
12441244test "truncating shift left" {
12451245 try testShlTrunc(maxInt(u16));
1246 comptime try testShlTrunc(maxInt(u16));
1246 try comptime testShlTrunc(maxInt(u16));
12471247}
12481248fn testShlTrunc(x: u16) !void {
12491249 const shifted = x << 1;
......@@ -1254,7 +1254,7 @@ test "exact shift left" {
12541254 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
12551255
12561256 try testShlExact(0b00110101);
1257 comptime try testShlExact(0b00110101);
1257 try comptime testShlExact(0b00110101);
12581258}
12591259fn testShlExact(x: u8) !void {
12601260 const shifted = @shlExact(x, 2);
......@@ -1265,7 +1265,7 @@ test "exact shift right" {
12651265 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
12661266
12671267 try testShrExact(0b10110100);
1268 comptime try testShrExact(0b10110100);
1268 try comptime testShrExact(0b10110100);
12691269}
12701270fn testShrExact(x: u8) !void {
12711271 const shifted = @shrExact(x, 2);
......@@ -1288,7 +1288,7 @@ test "shift left/right on u0 operand" {
12881288 }
12891289 };
12901290 try S.doTheTest();
1291 comptime try S.doTheTest();
1291 try comptime S.doTheTest();
12921292}
12931293
12941294test "comptime float rem int" {
......@@ -1311,11 +1311,11 @@ test "remainder division" {
13111311 return error.SkipZigTest;
13121312 }
13131313
1314 comptime try remdiv(f16);
1315 comptime try remdiv(f32);
1316 comptime try remdiv(f64);
1317 comptime try remdiv(f80);
1318 comptime try remdiv(f128);
1314 try comptime remdiv(f16);
1315 try comptime remdiv(f32);
1316 try comptime remdiv(f64);
1317 try comptime remdiv(f80);
1318 try comptime remdiv(f128);
13191319 try remdiv(f16);
13201320 try remdiv(f64);
13211321 try remdiv(f80);
......@@ -1343,11 +1343,11 @@ test "float remainder division using @rem" {
13431343 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
13441344 if (builtin.zig_backend == .stage2_x86_64) return error.SkipZigTest; // TODO
13451345
1346 comptime try frem(f16);
1347 comptime try frem(f32);
1348 comptime try frem(f64);
1349 comptime try frem(f80);
1350 comptime try frem(f128);
1346 try comptime frem(f16);
1347 try comptime frem(f32);
1348 try comptime frem(f64);
1349 try comptime frem(f80);
1350 try comptime frem(f128);
13511351 try frem(f16);
13521352 try frem(f32);
13531353 try frem(f64);
......@@ -1386,11 +1386,11 @@ test "float modulo division using @mod" {
13861386 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
13871387 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
13881388
1389 comptime try fmod(f16);
1390 comptime try fmod(f32);
1391 comptime try fmod(f64);
1392 comptime try fmod(f80);
1393 comptime try fmod(f128);
1389 try comptime fmod(f16);
1390 try comptime fmod(f32);
1391 try comptime fmod(f64);
1392 try comptime fmod(f80);
1393 try comptime fmod(f128);
13941394 try fmod(f16);
13951395 try fmod(f32);
13961396 try fmod(f64);
......@@ -1430,16 +1430,16 @@ test "@round" {
14301430 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
14311431
14321432 try testRound(f64, 12.0);
1433 comptime try testRound(f64, 12.0);
1433 try comptime testRound(f64, 12.0);
14341434 try testRound(f32, 12.0);
1435 comptime try testRound(f32, 12.0);
1435 try comptime testRound(f32, 12.0);
14361436 try testRound(f16, 12.0);
1437 comptime try testRound(f16, 12.0);
1437 try comptime testRound(f16, 12.0);
14381438
14391439 const x = 14.0;
14401440 const y = x + 0.4;
14411441 const z = @round(y);
1442 comptime try expect(x == z);
1442 try comptime expect(x == z);
14431443}
14441444
14451445test "@round f80" {
......@@ -1451,7 +1451,7 @@ test "@round f80" {
14511451 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
14521452
14531453 try testRound(f80, 12.0);
1454 comptime try testRound(f80, 12.0);
1454 try comptime testRound(f80, 12.0);
14551455}
14561456
14571457test "@round f128" {
......@@ -1463,7 +1463,7 @@ test "@round f128" {
14631463 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
14641464
14651465 try testRound(f128, 12.0);
1466 comptime try testRound(f128, 12.0);
1466 try comptime testRound(f128, 12.0);
14671467}
14681468
14691469fn testRound(comptime T: type, x: T) !void {
......@@ -1491,7 +1491,7 @@ test "vector integer addition" {
14911491 }
14921492 };
14931493 try S.doTheTest();
1494 comptime try S.doTheTest();
1494 try comptime S.doTheTest();
14951495}
14961496
14971497test "NaN comparison" {
......@@ -1506,10 +1506,10 @@ test "NaN comparison" {
15061506 try testNanEqNan(f32);
15071507 try testNanEqNan(f64);
15081508 try testNanEqNan(f128);
1509 comptime try testNanEqNan(f16);
1510 comptime try testNanEqNan(f32);
1511 comptime try testNanEqNan(f64);
1512 comptime try testNanEqNan(f128);
1509 try comptime testNanEqNan(f16);
1510 try comptime testNanEqNan(f32);
1511 try comptime testNanEqNan(f64);
1512 try comptime testNanEqNan(f128);
15131513}
15141514
15151515test "NaN comparison f80" {
......@@ -1521,7 +1521,7 @@ test "NaN comparison f80" {
15211521 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
15221522
15231523 try testNanEqNan(f80);
1524 comptime try testNanEqNan(f80);
1524 try comptime testNanEqNan(f80);
15251525}
15261526
15271527fn testNanEqNan(comptime F: type) !void {
......@@ -1556,7 +1556,7 @@ test "vector comparison" {
15561556 }
15571557 };
15581558 try S.doTheTest();
1559 comptime try S.doTheTest();
1559 try comptime S.doTheTest();
15601560}
15611561
15621562test "compare undefined literal with comptime_int" {
......@@ -1593,7 +1593,7 @@ test "signed zeros are represented properly" {
15931593 };
15941594
15951595 try S.doTheTest();
1596 comptime try S.doTheTest();
1596 try comptime S.doTheTest();
15971597}
15981598
15991599test "comptime sin and ln" {
......@@ -1609,7 +1609,7 @@ test "absFloat" {
16091609 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
16101610
16111611 try testAbsFloat();
1612 comptime try testAbsFloat();
1612 try comptime testAbsFloat();
16131613}
16141614fn testAbsFloat() !void {
16151615 try testAbsFloatOne(-10.05, 10.05);
test/behavior/maximum_minimum.zig+6-6
......@@ -19,7 +19,7 @@ test "@max" {
1919 }
2020 };
2121 try S.doTheTest();
22 comptime try S.doTheTest();
22 try comptime S.doTheTest();
2323}
2424
2525test "@max on vectors" {
......@@ -50,7 +50,7 @@ test "@max on vectors" {
5050 }
5151 };
5252 try S.doTheTest();
53 comptime try S.doTheTest();
53 try comptime S.doTheTest();
5454}
5555
5656test "@min" {
......@@ -68,7 +68,7 @@ test "@min" {
6868 }
6969 };
7070 try S.doTheTest();
71 comptime try S.doTheTest();
71 try comptime S.doTheTest();
7272}
7373
7474test "@min for vectors" {
......@@ -99,7 +99,7 @@ test "@min for vectors" {
9999 }
100100 };
101101 try S.doTheTest();
102 comptime try S.doTheTest();
102 try comptime S.doTheTest();
103103}
104104
105105test "@min/max for floats" {
......@@ -123,9 +123,9 @@ test "@min/max for floats" {
123123
124124 inline for (.{ f16, f32, f64, f80, f128, c_longdouble }) |T| {
125125 try S.doTheTest(T);
126 comptime try S.doTheTest(T);
126 try comptime S.doTheTest(T);
127127 }
128 comptime try S.doTheTest(comptime_float);
128 try comptime S.doTheTest(comptime_float);
129129}
130130
131131test "@min/@max on lazy values" {
test/behavior/muladd.zig+9-9
......@@ -12,7 +12,7 @@ test "@mulAdd" {
1212 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1313 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1414
15 comptime try testMulAdd();
15 try comptime testMulAdd();
1616 try testMulAdd();
1717}
1818
......@@ -38,7 +38,7 @@ test "@mulAdd f16" {
3838 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
3939 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
4040
41 comptime try testMulAdd16();
41 try comptime testMulAdd16();
4242 try testMulAdd16();
4343}
4444
......@@ -57,7 +57,7 @@ test "@mulAdd f80" {
5757 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
5858 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
5959
60 comptime try testMulAdd80();
60 try comptime testMulAdd80();
6161 try testMulAdd80();
6262}
6363
......@@ -76,7 +76,7 @@ test "@mulAdd f128" {
7676 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
7777 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
7878
79 comptime try testMulAdd128();
79 try comptime testMulAdd128();
8080 try testMulAdd128();
8181}
8282
......@@ -107,7 +107,7 @@ test "vector f16" {
107107 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
108108 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
109109
110 comptime try vector16();
110 try comptime vector16();
111111 try vector16();
112112}
113113
......@@ -131,7 +131,7 @@ test "vector f32" {
131131 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
132132 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
133133
134 comptime try vector32();
134 try comptime vector32();
135135 try vector32();
136136}
137137
......@@ -155,7 +155,7 @@ test "vector f64" {
155155 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
156156 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
157157
158 comptime try vector64();
158 try comptime vector64();
159159 try vector64();
160160}
161161
......@@ -178,7 +178,7 @@ test "vector f80" {
178178 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
179179 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
180180
181 comptime try vector80();
181 try comptime vector80();
182182 try vector80();
183183}
184184
......@@ -202,6 +202,6 @@ test "vector f128" {
202202 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
203203 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
204204
205 comptime try vector128();
205 try comptime vector128();
206206 try vector128();
207207}
test/behavior/null.zig+3-3
......@@ -56,7 +56,7 @@ test "maybe return" {
5656 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
5757
5858 try maybeReturnImpl();
59 comptime try maybeReturnImpl();
59 try comptime maybeReturnImpl();
6060}
6161
6262fn maybeReturnImpl() !void {
......@@ -87,7 +87,7 @@ test "optional void" {
8787 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
8888
8989 try optionalVoidImpl();
90 comptime try optionalVoidImpl();
90 try comptime optionalVoidImpl();
9191}
9292
9393fn optionalVoidImpl() !void {
......@@ -111,7 +111,7 @@ test "optional struct{}" {
111111 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
112112
113113 _ = try optionalEmptyStructImpl();
114 _ = comptime try optionalEmptyStructImpl();
114 _ = try comptime optionalEmptyStructImpl();
115115}
116116
117117fn optionalEmptyStructImpl() !void {
test/behavior/optional.zig+8-8
......@@ -20,7 +20,7 @@ test "passing an optional integer as a parameter" {
2020 }
2121 };
2222 try expect(S.entry());
23 comptime try expect(S.entry());
23 try comptime expect(S.entry());
2424}
2525
2626pub const EmptyStruct = struct {};
......@@ -38,7 +38,7 @@ test "equality compare optional pointers" {
3838 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
3939
4040 try testNullPtrsEql();
41 comptime try testNullPtrsEql();
41 try comptime testNullPtrsEql();
4242}
4343
4444fn testNullPtrsEql() !void {
......@@ -117,7 +117,7 @@ test "equality compare optional with non-optional" {
117117 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
118118
119119 try test_cmp_optional_non_optional();
120 comptime try test_cmp_optional_non_optional();
120 try comptime test_cmp_optional_non_optional();
121121}
122122
123123fn test_cmp_optional_non_optional() !void {
......@@ -168,7 +168,7 @@ test "unwrap function call with optional pointer return value" {
168168 }
169169 };
170170 try S.entry();
171 comptime try S.entry();
171 try comptime S.entry();
172172}
173173
174174test "nested orelse" {
......@@ -195,7 +195,7 @@ test "nested orelse" {
195195 };
196196 };
197197 try S.entry();
198 comptime try S.entry();
198 try comptime S.entry();
199199}
200200
201201test "self-referential struct through a slice of optional" {
......@@ -250,7 +250,7 @@ test "coerce an anon struct literal to optional struct" {
250250 }
251251 };
252252 try S.doTheTest();
253 comptime try S.doTheTest();
253 try comptime S.doTheTest();
254254}
255255
256256test "0-bit child type coerced to optional return ptr result location" {
......@@ -277,7 +277,7 @@ test "0-bit child type coerced to optional return ptr result location" {
277277 };
278278 };
279279 try S.doTheTest();
280 comptime try S.doTheTest();
280 try comptime S.doTheTest();
281281}
282282
283283test "0-bit child type coerced to optional" {
......@@ -303,7 +303,7 @@ test "0-bit child type coerced to optional" {
303303 };
304304 };
305305 try S.doTheTest();
306 comptime try S.doTheTest();
306 try comptime S.doTheTest();
307307}
308308
309309test "array of optional unaligned types" {
test/behavior/packed-struct.zig+1-1
......@@ -351,7 +351,7 @@ test "byte-aligned field pointer offsets" {
351351 };
352352
353353 try S.doTheTest();
354 comptime try S.doTheTest();
354 try comptime S.doTheTest();
355355}
356356
357357test "load pointer from packed struct" {
test/behavior/pointers.zig+35-35
......@@ -5,7 +5,7 @@ const expect = testing.expect;
55const expectError = testing.expectError;
66
77test "dereference pointer" {
8 comptime try testDerefPtr();
8 try comptime testDerefPtr();
99 try testDerefPtr();
1010}
1111
......@@ -42,7 +42,7 @@ test "pointer arithmetic" {
4242}
4343
4444test "double pointer parsing" {
45 comptime try expect(PtrOf(PtrOf(i32)) == **i32);
45 try comptime expect(PtrOf(PtrOf(i32)) == **i32);
4646}
4747
4848fn PtrOf(comptime T: type) type {
......@@ -62,7 +62,7 @@ test "implicit cast single item pointer to C pointer and back" {
6262test "initialize const optional C pointer to null" {
6363 const a: ?[*c]i32 = null;
6464 try expect(a == null);
65 comptime try expect(a == null);
65 try comptime expect(a == null);
6666}
6767
6868test "assigning integer to C pointer" {
......@@ -105,12 +105,12 @@ test "C pointer comparison and arithmetic" {
105105 }
106106 };
107107 try S.doTheTest();
108 comptime try S.doTheTest();
108 try comptime S.doTheTest();
109109}
110110
111111test "dereference pointer again" {
112112 try testDerefPtrOneVal();
113 comptime try testDerefPtrOneVal();
113 try comptime testDerefPtrOneVal();
114114}
115115
116116const Foo1 = struct {
......@@ -180,7 +180,7 @@ test "implicit cast error unions with non-optional to optional pointer" {
180180 }
181181 };
182182 try S.doTheTest();
183 comptime try S.doTheTest();
183 try comptime S.doTheTest();
184184}
185185
186186test "compare equality of optional and non-optional pointer" {
......@@ -203,11 +203,11 @@ test "allowzero pointer and slice" {
203203 try expect(@ptrToInt(ptr) == 0);
204204 var runtime_zero: usize = 0;
205205 var slice = ptr[runtime_zero..10];
206 comptime try expect(@TypeOf(slice) == []allowzero i32);
206 try comptime expect(@TypeOf(slice) == []allowzero i32);
207207 try expect(@ptrToInt(&slice[5]) == 20);
208208
209 comptime try expect(@typeInfo(@TypeOf(ptr)).Pointer.is_allowzero);
210 comptime try expect(@typeInfo(@TypeOf(slice)).Pointer.is_allowzero);
209 try comptime expect(@typeInfo(@TypeOf(ptr)).Pointer.is_allowzero);
210 try comptime expect(@typeInfo(@TypeOf(slice)).Pointer.is_allowzero);
211211}
212212
213213test "assign null directly to C pointer and test null equality" {
......@@ -229,17 +229,17 @@ test "assign null directly to C pointer and test null equality" {
229229 try expect((x orelse &otherx) == &otherx);
230230
231231 const y: [*c]i32 = null;
232 comptime try expect(y == null);
233 comptime try expect(null == y);
234 comptime try expect(!(y != null));
235 comptime try expect(!(null != y));
232 try comptime expect(y == null);
233 try comptime expect(null == y);
234 try comptime expect(!(y != null));
235 try comptime expect(!(null != y));
236236 if (y) |same_y| {
237237 _ = same_y;
238238 @panic("fail");
239239 }
240240 const othery: i32 = undefined;
241241 const ptr_othery = &othery;
242 comptime try expect((y orelse ptr_othery) == ptr_othery);
242 try comptime expect((y orelse ptr_othery) == ptr_othery);
243243
244244 var n: i32 = 1234;
245245 var x1: [*c]i32 = &n;
......@@ -257,17 +257,17 @@ test "assign null directly to C pointer and test null equality" {
257257
258258 const nc: i32 = 1234;
259259 const y1: [*c]const i32 = &nc;
260 comptime try expect(!(y1 == null));
261 comptime try expect(!(null == y1));
262 comptime try expect(y1 != null);
263 comptime try expect(null != y1);
264 comptime try expect(y1.?.* == 1234);
260 try comptime expect(!(y1 == null));
261 try comptime expect(!(null == y1));
262 try comptime expect(y1 != null);
263 try comptime expect(null != y1);
264 try comptime expect(y1.?.* == 1234);
265265 if (y1) |same_y1| {
266266 try expect(same_y1.* == 1234);
267267 } else {
268268 @compileError("fail");
269269 }
270 comptime try expect((y1 orelse &othery) == y1);
270 try comptime expect((y1 orelse &othery) == y1);
271271}
272272
273273test "array initialization types" {
......@@ -293,7 +293,7 @@ test "null terminated pointer" {
293293 }
294294 };
295295 try S.doTheTest();
296 comptime try S.doTheTest();
296 try comptime S.doTheTest();
297297}
298298
299299test "allow any sentinel" {
......@@ -308,7 +308,7 @@ test "allow any sentinel" {
308308 }
309309 };
310310 try S.doTheTest();
311 comptime try S.doTheTest();
311 try comptime S.doTheTest();
312312}
313313
314314test "pointer sentinel with enums" {
......@@ -325,11 +325,11 @@ test "pointer sentinel with enums" {
325325
326326 fn doTheTest() !void {
327327 var ptr: [*:.sentinel]const Number = &[_:.sentinel]Number{ .one, .two, .two, .one };
328 try expect(ptr[4] == .sentinel); // TODO this should be comptime try expect, see #3731
328 try expect(ptr[4] == .sentinel); // TODO this should be try comptime expect, see #3731
329329 }
330330 };
331331 try S.doTheTest();
332 comptime try S.doTheTest();
332 try comptime S.doTheTest();
333333}
334334
335335test "pointer sentinel with optional element" {
......@@ -341,11 +341,11 @@ test "pointer sentinel with optional element" {
341341 const S = struct {
342342 fn doTheTest() !void {
343343 var ptr: [*:null]const ?i32 = &[_:null]?i32{ 1, 2, 3, 4 };
344 try expect(ptr[4] == null); // TODO this should be comptime try expect, see #3731
344 try expect(ptr[4] == null); // TODO this should be try comptime expect, see #3731
345345 }
346346 };
347347 try S.doTheTest();
348 comptime try S.doTheTest();
348 try comptime S.doTheTest();
349349}
350350
351351test "pointer sentinel with +inf" {
......@@ -357,13 +357,13 @@ test "pointer sentinel with +inf" {
357357
358358 const S = struct {
359359 fn doTheTest() !void {
360 const inf = std.math.inf_f32;
361 var ptr: [*:inf]const f32 = &[_:inf]f32{ 1.1, 2.2, 3.3, 4.4 };
362 try expect(ptr[4] == inf); // TODO this should be comptime try expect, see #3731
360 const inf_f32 = comptime std.math.inf(f32);
361 var ptr: [*:inf_f32]const f32 = &[_:inf_f32]f32{ 1.1, 2.2, 3.3, 4.4 };
362 try expect(ptr[4] == inf_f32); // TODO this should be try comptime expect, see #3731
363363 }
364364 };
365365 try S.doTheTest();
366 comptime try S.doTheTest();
366 try comptime S.doTheTest();
367367}
368368
369369test "pointer to array at fixed address" {
......@@ -409,11 +409,11 @@ test "@ptrToInt on null optional at comptime" {
409409 const pointer = @intToPtr(?*u8, 0x000);
410410 const x = @ptrToInt(pointer);
411411 _ = x;
412 comptime try expect(0 == @ptrToInt(pointer));
412 try comptime expect(0 == @ptrToInt(pointer));
413413 }
414414 {
415415 const pointer = @intToPtr(?*u8, 0xf00);
416 comptime try expect(0xf00 == @ptrToInt(pointer));
416 try comptime expect(0xf00 == @ptrToInt(pointer));
417417 }
418418}
419419
......@@ -447,7 +447,7 @@ test "element pointer to slice" {
447447 };
448448
449449 try S.doTheTest();
450 comptime try S.doTheTest();
450 try comptime S.doTheTest();
451451}
452452
453453test "element pointer arithmetic to slice" {
......@@ -473,7 +473,7 @@ test "element pointer arithmetic to slice" {
473473 };
474474
475475 try S.doTheTest();
476 comptime try S.doTheTest();
476 try comptime S.doTheTest();
477477}
478478
479479test "array slicing to slice" {
......@@ -491,7 +491,7 @@ test "array slicing to slice" {
491491 };
492492
493493 try S.doTheTest();
494 comptime try S.doTheTest();
494 try comptime S.doTheTest();
495495}
496496
497497test "pointer to constant decl preserves alignment" {
test/behavior/popcount.zig+2-2
......@@ -9,7 +9,7 @@ test "@popCount integers" {
99 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1010 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1111
12 comptime try testPopCountIntegers();
12 try comptime testPopCountIntegers();
1313 try testPopCountIntegers();
1414}
1515
......@@ -75,7 +75,7 @@ test "@popCount vectors" {
7575 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
7676 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
7777
78 comptime try testPopCountVectors();
78 try comptime testPopCountVectors();
7979 try testPopCountVectors();
8080}
8181
test/behavior/ptrcast.zig+6-6
......@@ -7,7 +7,7 @@ test "reinterpret bytes as integer with nonzero offset" {
77 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
88
99 try testReinterpretBytesAsInteger();
10 comptime try testReinterpretBytesAsInteger();
10 try comptime testReinterpretBytesAsInteger();
1111}
1212
1313fn testReinterpretBytesAsInteger() !void {
......@@ -26,7 +26,7 @@ test "reinterpret an array over multiple elements, with no well-defined layout"
2626 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
2727
2828 try testReinterpretWithOffsetAndNoWellDefinedLayout();
29 comptime try testReinterpretWithOffsetAndNoWellDefinedLayout();
29 try comptime testReinterpretWithOffsetAndNoWellDefinedLayout();
3030}
3131
3232fn testReinterpretWithOffsetAndNoWellDefinedLayout() !void {
......@@ -41,7 +41,7 @@ test "reinterpret bytes inside auto-layout struct as integer with nonzero offset
4141 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
4242
4343 try testReinterpretStructWrappedBytesAsInteger();
44 comptime try testReinterpretStructWrappedBytesAsInteger();
44 try comptime testReinterpretStructWrappedBytesAsInteger();
4545}
4646
4747fn testReinterpretStructWrappedBytesAsInteger() !void {
......@@ -59,7 +59,7 @@ test "reinterpret bytes of an array into an extern struct" {
5959 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
6060
6161 try testReinterpretBytesAsExternStruct();
62 comptime try testReinterpretBytesAsExternStruct();
62 try comptime testReinterpretBytesAsExternStruct();
6363}
6464
6565fn testReinterpretBytesAsExternStruct() !void {
......@@ -80,7 +80,7 @@ test "reinterpret bytes of an extern struct (with under-aligned fields) into ano
8080 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
8181
8282 try testReinterpretExternStructAsExternStruct();
83 comptime try testReinterpretExternStructAsExternStruct();
83 try comptime testReinterpretExternStructAsExternStruct();
8484}
8585
8686fn testReinterpretExternStructAsExternStruct() !void {
......@@ -104,7 +104,7 @@ test "reinterpret bytes of an extern struct into another" {
104104 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
105105
106106 try testReinterpretOverAlignedExternStructAsExternStruct();
107 comptime try testReinterpretOverAlignedExternStructAsExternStruct();
107 try comptime testReinterpretOverAlignedExternStructAsExternStruct();
108108}
109109
110110fn testReinterpretOverAlignedExternStructAsExternStruct() !void {
test/behavior/saturating_arithmetic.zig+32-32
......@@ -38,16 +38,16 @@ test "saturating add" {
3838 };
3939
4040 try S.doTheTest();
41 comptime try S.doTheTest();
42
43 comptime try S.testSatAdd(comptime_int, 0, 0, 0);
44 comptime try S.testSatAdd(comptime_int, -1, 1, 0);
45 comptime try S.testSatAdd(comptime_int, 3, 2, 5);
46 comptime try S.testSatAdd(comptime_int, -3, -2, -5);
47 comptime try S.testSatAdd(comptime_int, 3, -2, 1);
48 comptime try S.testSatAdd(comptime_int, -3, 2, -1);
49 comptime try S.testSatAdd(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 1119305249183743626545271163355074748512);
50 comptime try S.testSatAdd(comptime_int, 7, -593423721213448152027139550640105366508, -593423721213448152027139550640105366501);
41 try comptime S.doTheTest();
42
43 try comptime S.testSatAdd(comptime_int, 0, 0, 0);
44 try comptime S.testSatAdd(comptime_int, -1, 1, 0);
45 try comptime S.testSatAdd(comptime_int, 3, 2, 5);
46 try comptime S.testSatAdd(comptime_int, -3, -2, -5);
47 try comptime S.testSatAdd(comptime_int, 3, -2, 1);
48 try comptime S.testSatAdd(comptime_int, -3, 2, -1);
49 try comptime S.testSatAdd(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 1119305249183743626545271163355074748512);
50 try comptime S.testSatAdd(comptime_int, 7, -593423721213448152027139550640105366508, -593423721213448152027139550640105366501);
5151}
5252
5353test "saturating add 128bit" {
......@@ -74,7 +74,7 @@ test "saturating add 128bit" {
7474 };
7575
7676 try S.doTheTest();
77 comptime try S.doTheTest();
77 try comptime S.doTheTest();
7878}
7979
8080test "saturating subtraction" {
......@@ -110,16 +110,16 @@ test "saturating subtraction" {
110110 };
111111
112112 try S.doTheTest();
113 comptime try S.doTheTest();
114
115 comptime try S.testSatSub(comptime_int, 0, 0, 0);
116 comptime try S.testSatSub(comptime_int, 1, 1, 0);
117 comptime try S.testSatSub(comptime_int, 3, 2, 1);
118 comptime try S.testSatSub(comptime_int, -3, -2, -1);
119 comptime try S.testSatSub(comptime_int, 3, -2, 5);
120 comptime try S.testSatSub(comptime_int, -3, 2, -5);
121 comptime try S.testSatSub(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 182846383813587550256162760261375991602);
122 comptime try S.testSatSub(comptime_int, 7, -593423721213448152027139550640105366508, 593423721213448152027139550640105366515);
113 try comptime S.doTheTest();
114
115 try comptime S.testSatSub(comptime_int, 0, 0, 0);
116 try comptime S.testSatSub(comptime_int, 1, 1, 0);
117 try comptime S.testSatSub(comptime_int, 3, 2, 1);
118 try comptime S.testSatSub(comptime_int, -3, -2, -1);
119 try comptime S.testSatSub(comptime_int, 3, -2, 5);
120 try comptime S.testSatSub(comptime_int, -3, 2, -5);
121 try comptime S.testSatSub(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 182846383813587550256162760261375991602);
122 try comptime S.testSatSub(comptime_int, 7, -593423721213448152027139550640105366508, 593423721213448152027139550640105366515);
123123}
124124
125125test "saturating subtraction 128bit" {
......@@ -147,7 +147,7 @@ test "saturating subtraction 128bit" {
147147 };
148148
149149 try S.doTheTest();
150 comptime try S.doTheTest();
150 try comptime S.doTheTest();
151151}
152152
153153test "saturating multiplication" {
......@@ -188,12 +188,12 @@ test "saturating multiplication" {
188188 };
189189
190190 try S.doTheTest();
191 comptime try S.doTheTest();
191 try comptime S.doTheTest();
192192
193 comptime try S.testSatMul(comptime_int, 0, 0, 0);
194 comptime try S.testSatMul(comptime_int, 3, 2, 6);
195 comptime try S.testSatMul(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 304852860194144160265083087140337419215516305999637969803722975979232817921935);
196 comptime try S.testSatMul(comptime_int, 7, -593423721213448152027139550640105366508, -4153966048494137064189976854480737565556);
193 try comptime S.testSatMul(comptime_int, 0, 0, 0);
194 try comptime S.testSatMul(comptime_int, 3, 2, 6);
195 try comptime S.testSatMul(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 304852860194144160265083087140337419215516305999637969803722975979232817921935);
196 try comptime S.testSatMul(comptime_int, 7, -593423721213448152027139550640105366508, -4153966048494137064189976854480737565556);
197197}
198198
199199test "saturating shift-left" {
......@@ -228,12 +228,12 @@ test "saturating shift-left" {
228228 };
229229
230230 try S.doTheTest();
231 comptime try S.doTheTest();
231 try comptime S.doTheTest();
232232
233 comptime try S.testSatShl(comptime_int, 0, 0, 0);
234 comptime try S.testSatShl(comptime_int, 1, 2, 4);
235 comptime try S.testSatShl(comptime_int, 13, 150, 18554220005177478453757717602843436772975706112);
236 comptime try S.testSatShl(comptime_int, -582769, 180, -893090893854873184096635538665358532628308979495815656505344);
233 try comptime S.testSatShl(comptime_int, 0, 0, 0);
234 try comptime S.testSatShl(comptime_int, 1, 2, 4);
235 try comptime S.testSatShl(comptime_int, 13, 150, 18554220005177478453757717602843436772975706112);
236 try comptime S.testSatShl(comptime_int, -582769, 180, -893090893854873184096635538665358532628308979495815656505344);
237237}
238238
239239test "saturating shl uses the LHS type" {
test/behavior/select.zig+2-2
......@@ -11,7 +11,7 @@ test "@select vectors" {
1111 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
1212 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
1313
14 comptime try selectVectors();
14 try comptime selectVectors();
1515 try selectVectors();
1616}
1717
......@@ -40,7 +40,7 @@ test "@select arrays" {
4040 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
4141 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
4242
43 comptime try selectArrays();
43 try comptime selectArrays();
4444 try selectArrays();
4545}
4646
test/behavior/shuffle.zig+3-3
......@@ -41,7 +41,7 @@ test "@shuffle int" {
4141 }
4242 };
4343 try S.doTheTest();
44 comptime try S.doTheTest();
44 try comptime S.doTheTest();
4545}
4646
4747test "@shuffle bool 1" {
......@@ -62,7 +62,7 @@ test "@shuffle bool 1" {
6262 }
6363 };
6464 try S.doTheTest();
65 comptime try S.doTheTest();
65 try comptime S.doTheTest();
6666}
6767
6868test "@shuffle bool 2" {
......@@ -88,5 +88,5 @@ test "@shuffle bool 2" {
8888 }
8989 };
9090 try S.doTheTest();
91 comptime try S.doTheTest();
91 try comptime S.doTheTest();
9292}
test/behavior/sizeof_and_typeof.zig+8-8
......@@ -24,21 +24,21 @@ test "@TypeOf() with multiple arguments" {
2424 var var_1: u32 = undefined;
2525 var var_2: u8 = undefined;
2626 var var_3: u64 = undefined;
27 comptime try expect(@TypeOf(var_1, var_2, var_3) == u64);
27 try comptime expect(@TypeOf(var_1, var_2, var_3) == u64);
2828 }
2929 {
3030 var var_1: f16 = undefined;
3131 var var_2: f32 = undefined;
3232 var var_3: f64 = undefined;
33 comptime try expect(@TypeOf(var_1, var_2, var_3) == f64);
33 try comptime expect(@TypeOf(var_1, var_2, var_3) == f64);
3434 }
3535 {
3636 var var_1: u16 = undefined;
37 comptime try expect(@TypeOf(var_1, 0xffff) == u16);
37 try comptime expect(@TypeOf(var_1, 0xffff) == u16);
3838 }
3939 {
4040 var var_1: f32 = undefined;
41 comptime try expect(@TypeOf(var_1, 3.1415) == f32);
41 try comptime expect(@TypeOf(var_1, 3.1415) == f32);
4242 }
4343}
4444
......@@ -148,7 +148,7 @@ test "@TypeOf() has no runtime side effects" {
148148 };
149149 var data: i32 = 0;
150150 const T = @TypeOf(S.foo(i32, &data));
151 comptime try expect(T == i32);
151 try comptime expect(T == i32);
152152 try expect(data == 0);
153153}
154154
......@@ -163,7 +163,7 @@ test "branching logic inside @TypeOf" {
163163 }
164164 };
165165 const T = @TypeOf(S.foo() catch undefined);
166 comptime try expect(T == i32);
166 try comptime expect(T == i32);
167167 try expect(S.data == 0);
168168}
169169
......@@ -236,7 +236,7 @@ test "hardcoded address in typeof expression" {
236236 }
237237 };
238238 try expect(S.func() == 0);
239 comptime try expect(S.func() == 0);
239 try comptime expect(S.func() == 0);
240240}
241241
242242test "array access of generic param in typeof expression" {
......@@ -246,7 +246,7 @@ test "array access of generic param in typeof expression" {
246246 }
247247 };
248248 try expect(S.first("a") == 'a');
249 comptime try expect(S.first("a") == 'a');
249 try comptime expect(S.first("a") == 'a');
250250}
251251
252252test "lazy size cast to float" {
test/behavior/slice.zig+75-75
......@@ -87,7 +87,7 @@ test "access len index of sentinel-terminated slice" {
8787 }
8888 };
8989 try S.doTheTest();
90 comptime try S.doTheTest();
90 try comptime S.doTheTest();
9191}
9292
9393test "comptime slice of slice preserves comptime var" {
......@@ -139,7 +139,7 @@ test "slice of hardcoded address to pointer" {
139139 const S = struct {
140140 fn doTheTest() !void {
141141 const pointer = @intToPtr([*]u8, 0x04)[0..2];
142 comptime try expect(@TypeOf(pointer) == *[2]u8);
142 try comptime expect(@TypeOf(pointer) == *[2]u8);
143143 const slice: []const u8 = pointer;
144144 try expect(@ptrToInt(slice.ptr) == 4);
145145 try expect(slice.len == 2);
......@@ -214,9 +214,9 @@ test "slice string literal has correct type" {
214214 try expect(@TypeOf(array[0..]) == *const [4]i32);
215215 }
216216 var runtime_zero: usize = 0;
217 comptime try expect(@TypeOf("aoeu"[runtime_zero..]) == [:0]const u8);
217 try comptime expect(@TypeOf("aoeu"[runtime_zero..]) == [:0]const u8);
218218 const array = [_]i32{ 1, 2, 3, 4 };
219 comptime try expect(@TypeOf(array[runtime_zero..]) == []const i32);
219 try comptime expect(@TypeOf(array[runtime_zero..]) == []const i32);
220220}
221221
222222test "result location zero sized array inside struct field implicit cast to slice" {
......@@ -265,8 +265,8 @@ test "C pointer slice access" {
265265 const c_ptr = @ptrCast([*c]const u32, &buf);
266266
267267 var runtime_zero: usize = 0;
268 comptime try expectEqual([]const u32, @TypeOf(c_ptr[runtime_zero..1]));
269 comptime try expectEqual(*const [1]u32, @TypeOf(c_ptr[0..1]));
268 try comptime expectEqual([]const u32, @TypeOf(c_ptr[runtime_zero..1]));
269 try comptime expectEqual(*const [1]u32, @TypeOf(c_ptr[0..1]));
270270
271271 for (c_ptr[0..5]) |*cl| {
272272 try expect(@as(u32, 42) == cl.*);
......@@ -320,10 +320,10 @@ test "obtaining a null terminated slice" {
320320 var runtime_len: usize = 3;
321321 const ptr2 = buf[0..runtime_len :0];
322322 // ptr2 is a null-terminated slice
323 comptime try expect(@TypeOf(ptr2) == [:0]u8);
324 comptime try expect(@TypeOf(ptr2[0..2]) == *[2]u8);
323 try comptime expect(@TypeOf(ptr2) == [:0]u8);
324 try comptime expect(@TypeOf(ptr2[0..2]) == *[2]u8);
325325 var runtime_zero: usize = 0;
326 comptime try expect(@TypeOf(ptr2[runtime_zero..2]) == []u8);
326 try comptime expect(@TypeOf(ptr2[runtime_zero..2]) == []u8);
327327}
328328
329329test "empty array to slice" {
......@@ -340,7 +340,7 @@ test "empty array to slice" {
340340 };
341341
342342 try S.doTheTest();
343 comptime try S.doTheTest();
343 try comptime S.doTheTest();
344344}
345345
346346test "@ptrCast slice to pointer" {
......@@ -358,7 +358,7 @@ test "@ptrCast slice to pointer" {
358358 };
359359
360360 try S.doTheTest();
361 comptime try S.doTheTest();
361 try comptime S.doTheTest();
362362}
363363
364364test "slice syntax resulting in pointer-to-array" {
......@@ -389,29 +389,29 @@ test "slice syntax resulting in pointer-to-array" {
389389 fn testArray() !void {
390390 var array = [5]u8{ 1, 2, 3, 4, 5 };
391391 var slice = array[1..3];
392 comptime try expect(@TypeOf(slice) == *[2]u8);
392 try comptime expect(@TypeOf(slice) == *[2]u8);
393393 try expect(slice[0] == 2);
394394 try expect(slice[1] == 3);
395395 }
396396
397397 fn testArrayZ() !void {
398398 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
399 comptime try expect(@TypeOf(array[1..3]) == *[2]u8);
400 comptime try expect(@TypeOf(array[1..5]) == *[4:0]u8);
401 comptime try expect(@TypeOf(array[1..]) == *[4:0]u8);
402 comptime try expect(@TypeOf(array[1..3 :4]) == *[2:4]u8);
399 try comptime expect(@TypeOf(array[1..3]) == *[2]u8);
400 try comptime expect(@TypeOf(array[1..5]) == *[4:0]u8);
401 try comptime expect(@TypeOf(array[1..]) == *[4:0]u8);
402 try comptime expect(@TypeOf(array[1..3 :4]) == *[2:4]u8);
403403 }
404404
405405 fn testArray0() !void {
406406 {
407407 var array = [0]u8{};
408408 var slice = array[0..0];
409 comptime try expect(@TypeOf(slice) == *[0]u8);
409 try comptime expect(@TypeOf(slice) == *[0]u8);
410410 }
411411 {
412412 var array = [0:0]u8{};
413413 var slice = array[0..0];
414 comptime try expect(@TypeOf(slice) == *[0:0]u8);
414 try comptime expect(@TypeOf(slice) == *[0:0]u8);
415415 try expect(slice[0] == 0);
416416 }
417417 }
......@@ -419,16 +419,16 @@ test "slice syntax resulting in pointer-to-array" {
419419 fn testArrayAlign() !void {
420420 var array align(4) = [5]u8{ 1, 2, 3, 4, 5 };
421421 var slice = array[4..5];
422 comptime try expect(@TypeOf(slice) == *align(4) [1]u8);
422 try comptime expect(@TypeOf(slice) == *align(4) [1]u8);
423423 try expect(slice[0] == 5);
424 comptime try expect(@TypeOf(array[0..2]) == *align(4) [2]u8);
424 try comptime expect(@TypeOf(array[0..2]) == *align(4) [2]u8);
425425 }
426426
427427 fn testPointer() !void {
428428 var array = [5]u8{ 1, 2, 3, 4, 5 };
429429 var pointer: [*]u8 = &array;
430430 var slice = pointer[1..3];
431 comptime try expect(@TypeOf(slice) == *[2]u8);
431 try comptime expect(@TypeOf(slice) == *[2]u8);
432432 try expect(slice[0] == 2);
433433 try expect(slice[1] == 3);
434434 }
......@@ -436,14 +436,14 @@ test "slice syntax resulting in pointer-to-array" {
436436 fn testPointerZ() !void {
437437 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
438438 var pointer: [*:0]u8 = &array;
439 comptime try expect(@TypeOf(pointer[1..3]) == *[2]u8);
440 comptime try expect(@TypeOf(pointer[1..3 :4]) == *[2:4]u8);
439 try comptime expect(@TypeOf(pointer[1..3]) == *[2]u8);
440 try comptime expect(@TypeOf(pointer[1..3 :4]) == *[2:4]u8);
441441 }
442442
443443 fn testPointer0() !void {
444444 var pointer: [*]const u0 = &[1]u0{0};
445445 var slice = pointer[0..1];
446 comptime try expect(@TypeOf(slice) == *const [1]u0);
446 try comptime expect(@TypeOf(slice) == *const [1]u0);
447447 try expect(slice[0] == 0);
448448 }
449449
......@@ -451,16 +451,16 @@ test "slice syntax resulting in pointer-to-array" {
451451 var array align(4) = [5]u8{ 1, 2, 3, 4, 5 };
452452 var pointer: [*]align(4) u8 = &array;
453453 var slice = pointer[4..5];
454 comptime try expect(@TypeOf(slice) == *align(4) [1]u8);
454 try comptime expect(@TypeOf(slice) == *align(4) [1]u8);
455455 try expect(slice[0] == 5);
456 comptime try expect(@TypeOf(pointer[0..2]) == *align(4) [2]u8);
456 try comptime expect(@TypeOf(pointer[0..2]) == *align(4) [2]u8);
457457 }
458458
459459 fn testSlice() !void {
460460 var array = [5]u8{ 1, 2, 3, 4, 5 };
461461 var src_slice: []u8 = &array;
462462 var slice = src_slice[1..3];
463 comptime try expect(@TypeOf(slice) == *[2]u8);
463 try comptime expect(@TypeOf(slice) == *[2]u8);
464464 try expect(slice[0] == 2);
465465 try expect(slice[1] == 3);
466466 }
......@@ -468,26 +468,26 @@ test "slice syntax resulting in pointer-to-array" {
468468 fn testSliceZ() !void {
469469 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
470470 var slice: [:0]u8 = &array;
471 comptime try expect(@TypeOf(slice[1..3]) == *[2]u8);
472 comptime try expect(@TypeOf(slice[1..]) == [:0]u8);
473 comptime try expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8);
471 try comptime expect(@TypeOf(slice[1..3]) == *[2]u8);
472 try comptime expect(@TypeOf(slice[1..]) == [:0]u8);
473 try comptime expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8);
474474 }
475475
476476 fn testSliceOpt() !void {
477477 var array: [2]u8 = [2]u8{ 1, 2 };
478478 var slice: ?[]u8 = &array;
479 comptime try expect(@TypeOf(&array, slice) == ?[]u8);
480 comptime try expect(@TypeOf(slice, &array) == ?[]u8);
481 comptime try expect(@TypeOf(slice.?[0..2]) == *[2]u8);
479 try comptime expect(@TypeOf(&array, slice) == ?[]u8);
480 try comptime expect(@TypeOf(slice, &array) == ?[]u8);
481 try comptime expect(@TypeOf(slice.?[0..2]) == *[2]u8);
482482 }
483483
484484 fn testSliceAlign() !void {
485485 var array align(4) = [5]u8{ 1, 2, 3, 4, 5 };
486486 var src_slice: []align(4) u8 = &array;
487487 var slice = src_slice[4..5];
488 comptime try expect(@TypeOf(slice) == *align(4) [1]u8);
488 try comptime expect(@TypeOf(slice) == *align(4) [1]u8);
489489 try expect(slice[0] == 5);
490 comptime try expect(@TypeOf(src_slice[0..2]) == *align(4) [2]u8);
490 try comptime expect(@TypeOf(src_slice[0..2]) == *align(4) [2]u8);
491491 }
492492
493493 fn testConcatStrLiterals() !void {
......@@ -498,67 +498,67 @@ test "slice syntax resulting in pointer-to-array" {
498498 fn testSliceLength() !void {
499499 var array = [5]u8{ 1, 2, 3, 4, 5 };
500500 var slice: []u8 = &array;
501 comptime try expect(@TypeOf(slice[1..][0..2]) == *[2]u8);
502 comptime try expect(@TypeOf(slice[1..][0..4]) == *[4]u8);
503 comptime try expect(@TypeOf(slice[1..][0..2 :4]) == *[2:4]u8);
501 try comptime expect(@TypeOf(slice[1..][0..2]) == *[2]u8);
502 try comptime expect(@TypeOf(slice[1..][0..4]) == *[4]u8);
503 try comptime expect(@TypeOf(slice[1..][0..2 :4]) == *[2:4]u8);
504504 }
505505
506506 fn testSliceLengthZ() !void {
507507 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
508508 var slice: [:0]u8 = &array;
509 comptime try expect(@TypeOf(slice[1..][0..2]) == *[2]u8);
510 comptime try expect(@TypeOf(slice[1..][0..2 :4]) == *[2:4]u8);
511 comptime try expect(@TypeOf(slice[1.. :0][0..2]) == *[2]u8);
512 comptime try expect(@TypeOf(slice[1.. :0][0..2 :4]) == *[2:4]u8);
509 try comptime expect(@TypeOf(slice[1..][0..2]) == *[2]u8);
510 try comptime expect(@TypeOf(slice[1..][0..2 :4]) == *[2:4]u8);
511 try comptime expect(@TypeOf(slice[1.. :0][0..2]) == *[2]u8);
512 try comptime expect(@TypeOf(slice[1.. :0][0..2 :4]) == *[2:4]u8);
513513 }
514514
515515 fn testArrayLength() !void {
516516 var array = [5]u8{ 1, 2, 3, 4, 5 };
517 comptime try expect(@TypeOf(array[1..][0..2]) == *[2]u8);
518 comptime try expect(@TypeOf(array[1..][0..4]) == *[4]u8);
519 comptime try expect(@TypeOf(array[1..][0..2 :4]) == *[2:4]u8);
517 try comptime expect(@TypeOf(array[1..][0..2]) == *[2]u8);
518 try comptime expect(@TypeOf(array[1..][0..4]) == *[4]u8);
519 try comptime expect(@TypeOf(array[1..][0..2 :4]) == *[2:4]u8);
520520 }
521521
522522 fn testArrayLengthZ() !void {
523523 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
524 comptime try expect(@TypeOf(array[1..][0..2]) == *[2]u8);
525 comptime try expect(@TypeOf(array[1..][0..4]) == *[4:0]u8);
526 comptime try expect(@TypeOf(array[1..][0..2 :4]) == *[2:4]u8);
527 comptime try expect(@TypeOf(array[1.. :0][0..2]) == *[2]u8);
528 comptime try expect(@TypeOf(array[1.. :0][0..4]) == *[4:0]u8);
529 comptime try expect(@TypeOf(array[1.. :0][0..2 :4]) == *[2:4]u8);
524 try comptime expect(@TypeOf(array[1..][0..2]) == *[2]u8);
525 try comptime expect(@TypeOf(array[1..][0..4]) == *[4:0]u8);
526 try comptime expect(@TypeOf(array[1..][0..2 :4]) == *[2:4]u8);
527 try comptime expect(@TypeOf(array[1.. :0][0..2]) == *[2]u8);
528 try comptime expect(@TypeOf(array[1.. :0][0..4]) == *[4:0]u8);
529 try comptime expect(@TypeOf(array[1.. :0][0..2 :4]) == *[2:4]u8);
530530 }
531531
532532 fn testMultiPointer() !void {
533533 var array = [5]u8{ 1, 2, 3, 4, 5 };
534534 var ptr: [*]u8 = &array;
535 comptime try expect(@TypeOf(ptr[1..][0..2]) == *[2]u8);
536 comptime try expect(@TypeOf(ptr[1..][0..4]) == *[4]u8);
537 comptime try expect(@TypeOf(ptr[1..][0..2 :4]) == *[2:4]u8);
535 try comptime expect(@TypeOf(ptr[1..][0..2]) == *[2]u8);
536 try comptime expect(@TypeOf(ptr[1..][0..4]) == *[4]u8);
537 try comptime expect(@TypeOf(ptr[1..][0..2 :4]) == *[2:4]u8);
538538 }
539539
540540 fn testMultiPointerLengthZ() !void {
541541 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
542542 var ptr: [*]u8 = &array;
543 comptime try expect(@TypeOf(ptr[1..][0..2]) == *[2]u8);
544 comptime try expect(@TypeOf(ptr[1..][0..4]) == *[4:0]u8);
545 comptime try expect(@TypeOf(ptr[1..][0..2 :4]) == *[2:4]u8);
546 comptime try expect(@TypeOf(ptr[1.. :0][0..2]) == *[2]u8);
547 comptime try expect(@TypeOf(ptr[1.. :0][0..4]) == *[4:0]u8);
548 comptime try expect(@TypeOf(ptr[1.. :0][0..2 :4]) == *[2:4]u8);
543 try comptime expect(@TypeOf(ptr[1..][0..2]) == *[2]u8);
544 try comptime expect(@TypeOf(ptr[1..][0..4]) == *[4:0]u8);
545 try comptime expect(@TypeOf(ptr[1..][0..2 :4]) == *[2:4]u8);
546 try comptime expect(@TypeOf(ptr[1.. :0][0..2]) == *[2]u8);
547 try comptime expect(@TypeOf(ptr[1.. :0][0..4]) == *[4:0]u8);
548 try comptime expect(@TypeOf(ptr[1.. :0][0..2 :4]) == *[2:4]u8);
549549
550550 var ptr_z: [*:0]u8 = &array;
551 comptime try expect(@TypeOf(ptr_z[1..][0..2]) == *[2]u8);
552 comptime try expect(@TypeOf(ptr_z[1..][0..4]) == *[4:0]u8);
553 comptime try expect(@TypeOf(ptr_z[1..][0..2 :4]) == *[2:4]u8);
554 comptime try expect(@TypeOf(ptr_z[1.. :0][0..2]) == *[2]u8);
555 comptime try expect(@TypeOf(ptr_z[1.. :0][0..4]) == *[4:0]u8);
556 comptime try expect(@TypeOf(ptr_z[1.. :0][0..2 :4]) == *[2:4]u8);
551 try comptime expect(@TypeOf(ptr_z[1..][0..2]) == *[2]u8);
552 try comptime expect(@TypeOf(ptr_z[1..][0..4]) == *[4:0]u8);
553 try comptime expect(@TypeOf(ptr_z[1..][0..2 :4]) == *[2:4]u8);
554 try comptime expect(@TypeOf(ptr_z[1.. :0][0..2]) == *[2]u8);
555 try comptime expect(@TypeOf(ptr_z[1.. :0][0..4]) == *[4:0]u8);
556 try comptime expect(@TypeOf(ptr_z[1.. :0][0..2 :4]) == *[2:4]u8);
557557 }
558558 };
559559
560560 try S.doTheTest();
561 comptime try S.doTheTest();
561 try comptime S.doTheTest();
562562}
563563
564564test "slice pointer-to-array null terminated" {
......@@ -576,9 +576,9 @@ test "slice pointer-to-array null terminated" {
576576
577577 var array = [5:0]u8{ 1, 2, 3, 4, 5 };
578578 var slice: [:0]u8 = &array;
579 comptime try expect(@TypeOf(slice[1..3]) == *[2]u8);
580 comptime try expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8);
581 comptime try expect(@TypeOf(slice[1..]) == [:0]u8);
579 try comptime expect(@TypeOf(slice[1..3]) == *[2]u8);
580 try comptime expect(@TypeOf(slice[1..3 :4]) == *[2:4]u8);
581 try comptime expect(@TypeOf(slice[1..]) == [:0]u8);
582582}
583583
584584test "slice pointer-to-array zero length" {
......@@ -604,13 +604,13 @@ test "slice pointer-to-array zero length" {
604604 var array = [0]u8{};
605605 var src_slice: []u8 = &array;
606606 var slice = src_slice[0..0];
607 comptime try expect(@TypeOf(slice) == *[0]u8);
607 try comptime expect(@TypeOf(slice) == *[0]u8);
608608 }
609609 {
610610 var array = [0:0]u8{};
611611 var src_slice: [:0]u8 = &array;
612612 var slice = src_slice[0..0];
613 comptime try expect(@TypeOf(slice) == *[0]u8);
613 try comptime expect(@TypeOf(slice) == *[0]u8);
614614 }
615615}
616616
......@@ -647,7 +647,7 @@ test "type coercion of pointer to anon struct literal to pointer to slice" {
647647 }
648648 };
649649 try S.doTheTest();
650 comptime try S.doTheTest();
650 try comptime S.doTheTest();
651651}
652652
653653test "array concat of slices gives ptr to array" {
......@@ -719,7 +719,7 @@ test "slicing array with sentinel as end index" {
719719 };
720720
721721 try S.do();
722 comptime try S.do();
722 try comptime S.do();
723723}
724724
725725test "slicing slice with sentinel as end index" {
......@@ -739,7 +739,7 @@ test "slicing slice with sentinel as end index" {
739739 };
740740
741741 try S.do();
742 comptime try S.do();
742 try comptime S.do();
743743}
744744
745745test "slice len modification at comptime" {
test/behavior/struct.zig+18-18
......@@ -268,7 +268,7 @@ test "struct field init with catch" {
268268 };
269269 };
270270 try S.doTheTest();
271 comptime try S.doTheTest();
271 try comptime S.doTheTest();
272272}
273273
274274const blah: packed struct {
......@@ -603,7 +603,7 @@ test "bit field access" {
603603 try expect(getA(&data) == 1);
604604 try expect(getB(&data) == 2);
605605 try expect(getC(&data) == 3);
606 comptime try expect(@sizeOf(BitField1) == 1);
606 try comptime expect(@sizeOf(BitField1) == 1);
607607
608608 data.b += 1;
609609 try expect(data.b == 3);
......@@ -740,7 +740,7 @@ test "packed struct with u0 field access" {
740740 f0: u0,
741741 };
742742 var s = S{ .f0 = 0 };
743 comptime try expect(s.f0 == 0);
743 try comptime expect(s.f0 == 0);
744744}
745745
746746test "access to global struct fields" {
......@@ -817,7 +817,7 @@ test "fn with C calling convention returns struct by value" {
817817 }
818818 };
819819 try S.entry();
820 comptime try S.entry();
820 try comptime S.entry();
821821}
822822
823823test "non-packed struct with u128 entry in union" {
......@@ -889,7 +889,7 @@ test "anonymous struct literal syntax" {
889889 }
890890 };
891891 try S.doTheTest();
892 comptime try S.doTheTest();
892 try comptime S.doTheTest();
893893}
894894
895895test "fully anonymous struct" {
......@@ -911,7 +911,7 @@ test "fully anonymous struct" {
911911 }
912912 };
913913 try S.doTheTest();
914 comptime try S.doTheTest();
914 try comptime S.doTheTest();
915915}
916916
917917test "fully anonymous list literal" {
......@@ -928,7 +928,7 @@ test "fully anonymous list literal" {
928928 }
929929 };
930930 try S.doTheTest();
931 comptime try S.doTheTest();
931 try comptime S.doTheTest();
932932}
933933
934934test "tuple assigned to variable" {
......@@ -955,7 +955,7 @@ test "comptime struct field" {
955955 comptime std.debug.assert(@sizeOf(T) == 4);
956956
957957 var foo: T = undefined;
958 comptime try expect(foo.b == 1234);
958 try comptime expect(foo.b == 1234);
959959}
960960
961961test "tuple element initialized with fn call" {
......@@ -974,7 +974,7 @@ test "tuple element initialized with fn call" {
974974 }
975975 };
976976 try S.doTheTest();
977 comptime try S.doTheTest();
977 try comptime S.doTheTest();
978978}
979979
980980test "struct with union field" {
......@@ -1033,7 +1033,7 @@ test "type coercion of anon struct literal to struct" {
10331033 }
10341034 };
10351035 try S.doTheTest();
1036 comptime try S.doTheTest();
1036 try comptime S.doTheTest();
10371037}
10381038
10391039test "type coercion of pointer to anon struct literal to pointer to struct" {
......@@ -1071,7 +1071,7 @@ test "type coercion of pointer to anon struct literal to pointer to struct" {
10711071 }
10721072 };
10731073 try S.doTheTest();
1074 comptime try S.doTheTest();
1074 try comptime S.doTheTest();
10751075}
10761076
10771077test "packed struct with undefined initializers" {
......@@ -1104,7 +1104,7 @@ test "packed struct with undefined initializers" {
11041104 };
11051105
11061106 try S.doTheTest();
1107 comptime try S.doTheTest();
1107 try comptime S.doTheTest();
11081108}
11091109
11101110test "for loop over pointers to struct, getting field from struct pointer" {
......@@ -1169,7 +1169,7 @@ test "anon init through error unions and optionals" {
11691169 };
11701170
11711171 try S.doTheTest();
1172 comptime try S.doTheTest();
1172 try comptime S.doTheTest();
11731173}
11741174
11751175test "anon init through optional" {
......@@ -1189,7 +1189,7 @@ test "anon init through optional" {
11891189 };
11901190
11911191 try S.doTheTest();
1192 comptime try S.doTheTest();
1192 try comptime S.doTheTest();
11931193}
11941194
11951195test "anon init through error union" {
......@@ -1209,7 +1209,7 @@ test "anon init through error union" {
12091209 };
12101210
12111211 try S.doTheTest();
1212 comptime try S.doTheTest();
1212 try comptime S.doTheTest();
12131213}
12141214
12151215test "typed init through error unions and optionals" {
......@@ -1236,7 +1236,7 @@ test "typed init through error unions and optionals" {
12361236 };
12371237
12381238 try S.doTheTest();
1239 comptime try S.doTheTest();
1239 try comptime S.doTheTest();
12401240}
12411241
12421242test "initialize struct with empty literal" {
......@@ -1311,7 +1311,7 @@ test "packed struct field access via pointer" {
13111311 }
13121312 };
13131313 try S.doTheTest();
1314 comptime try S.doTheTest();
1314 try comptime S.doTheTest();
13151315}
13161316
13171317test "store to comptime field" {
......@@ -1416,7 +1416,7 @@ test "fieldParentPtr of a zero-bit field" {
14161416 }
14171417 };
14181418 try S.doTheTest();
1419 comptime try S.doTheTest();
1419 try comptime S.doTheTest();
14201420}
14211421
14221422test "struct field has a pointer to an aligned version of itself" {
test/behavior/switch.zig+20-20
......@@ -121,7 +121,7 @@ test "switching on booleans" {
121121 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
122122
123123 try testSwitchOnBools();
124 comptime try testSwitchOnBools();
124 try comptime testSwitchOnBools();
125125}
126126
127127fn testSwitchOnBools() !void {
......@@ -186,10 +186,10 @@ test "switch variable for range and multiple prongs" {
186186 fn doTheTest() !void {
187187 var u: u8 = 16;
188188 try doTheSwitch(u);
189 comptime try doTheSwitch(u);
189 try comptime doTheSwitch(u);
190190 var v: u8 = 42;
191191 try doTheSwitch(v);
192 comptime try doTheSwitch(v);
192 try comptime doTheSwitch(v);
193193 }
194194 fn doTheSwitch(q: u8) !void {
195195 switch (q) {
......@@ -260,7 +260,7 @@ test "switch on enum using pointer capture" {
260260 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
261261
262262 try testSwitchEnumPtrCapture();
263 comptime try testSwitchEnumPtrCapture();
263 try comptime testSwitchEnumPtrCapture();
264264}
265265
266266fn testSwitchEnumPtrCapture() !void {
......@@ -279,7 +279,7 @@ test "switch handles all cases of number" {
279279 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
280280
281281 try testSwitchHandleAllCases();
282 comptime try testSwitchHandleAllCases();
282 try comptime testSwitchHandleAllCases();
283283}
284284
285285fn testSwitchHandleAllCases() !void {
......@@ -373,7 +373,7 @@ test "switch all prongs unreachable" {
373373 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
374374
375375 try testAllProngsUnreachable();
376 comptime try testAllProngsUnreachable();
376 try comptime testAllProngsUnreachable();
377377}
378378
379379fn testAllProngsUnreachable() !void {
......@@ -421,7 +421,7 @@ test "switch on integer with else capturing expr" {
421421 }
422422 };
423423 try S.doTheTest();
424 comptime try S.doTheTest();
424 try comptime S.doTheTest();
425425}
426426
427427test "else prong of switch on error set excludes other cases" {
......@@ -456,7 +456,7 @@ test "else prong of switch on error set excludes other cases" {
456456 }
457457 };
458458 try S.doTheTest();
459 comptime try S.doTheTest();
459 try comptime S.doTheTest();
460460}
461461
462462test "switch prongs with error set cases make a new error set type for capture value" {
......@@ -493,7 +493,7 @@ test "switch prongs with error set cases make a new error set type for capture v
493493 }
494494 };
495495 try S.doTheTest();
496 comptime try S.doTheTest();
496 try comptime S.doTheTest();
497497}
498498
499499test "return result loc and then switch with range implicit casted to error union" {
......@@ -512,7 +512,7 @@ test "return result loc and then switch with range implicit casted to error unio
512512 }
513513 };
514514 try S.doTheTest();
515 comptime try S.doTheTest();
515 try comptime S.doTheTest();
516516}
517517
518518test "switch with null and T peer types and inferred result location type" {
......@@ -532,7 +532,7 @@ test "switch with null and T peer types and inferred result location type" {
532532 }
533533 };
534534 try S.doTheTest(1);
535 comptime try S.doTheTest(1);
535 try comptime S.doTheTest(1);
536536}
537537
538538test "switch prongs with cases with identical payload types" {
......@@ -577,7 +577,7 @@ test "switch prongs with cases with identical payload types" {
577577 }
578578 };
579579 try S.doTheTest();
580 comptime try S.doTheTest();
580 try comptime S.doTheTest();
581581}
582582
583583test "switch on pointer type" {
......@@ -606,9 +606,9 @@ test "switch on pointer type" {
606606 try expect(1 == S.doTheTest(S.P1));
607607 try expect(2 == S.doTheTest(S.P2));
608608 try expect(3 == S.doTheTest(S.P3));
609 comptime try expect(1 == S.doTheTest(S.P1));
610 comptime try expect(2 == S.doTheTest(S.P2));
611 comptime try expect(3 == S.doTheTest(S.P3));
609 try comptime expect(1 == S.doTheTest(S.P1));
610 try comptime expect(2 == S.doTheTest(S.P2));
611 try comptime expect(3 == S.doTheTest(S.P3));
612612}
613613
614614test "switch on error set with single else" {
......@@ -624,7 +624,7 @@ test "switch on error set with single else" {
624624 };
625625
626626 try S.doTheTest();
627 comptime try S.doTheTest();
627 try comptime S.doTheTest();
628628}
629629
630630test "switch capture copies its payload" {
......@@ -650,7 +650,7 @@ test "switch capture copies its payload" {
650650 }
651651 };
652652 try S.doTheTest();
653 comptime try S.doTheTest();
653 try comptime S.doTheTest();
654654}
655655
656656test "capture of integer forwards the switch condition directly" {
......@@ -670,8 +670,8 @@ test "capture of integer forwards the switch condition directly" {
670670 };
671671 try S.foo(42);
672672 try S.foo(100);
673 comptime try S.foo(42);
674 comptime try S.foo(100);
673 try comptime S.foo(42);
674 try comptime S.foo(100);
675675}
676676
677677test "enum value without tag name used as switch item" {
......@@ -702,7 +702,7 @@ test "switch item sizeof" {
702702 }
703703 };
704704 try S.doTheTest();
705 comptime try S.doTheTest();
705 try comptime S.doTheTest();
706706}
707707
708708test "comptime inline switch" {
test/behavior/truncate.zig+3-3
......@@ -5,7 +5,7 @@ const expect = std.testing.expect;
55test "truncate u0 to larger integer allowed and has comptime-known result" {
66 var x: u0 = 0;
77 const y = @truncate(u8, x);
8 comptime try expect(y == 0);
8 try comptime expect(y == 0);
99}
1010
1111test "truncate.u0.literal" {
......@@ -28,7 +28,7 @@ test "truncate.u0.var" {
2828test "truncate i0 to larger integer allowed and has comptime-known result" {
2929 var x: i0 = 0;
3030 const y = @truncate(i8, x);
31 comptime try expect(y == 0);
31 try comptime expect(y == 0);
3232}
3333
3434test "truncate.i0.literal" {
......@@ -73,6 +73,6 @@ test "truncate on vectors" {
7373 try expect(std.mem.eql(u8, &@as([4]u8, v2), &[4]u8{ 0xbb, 0xdd, 0xff, 0x22 }));
7474 }
7575 };
76 comptime try S.doTheTest();
76 try comptime S.doTheTest();
7777 try S.doTheTest();
7878}
test/behavior/try.zig+1-1
......@@ -7,7 +7,7 @@ test "try on error union" {
77 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
88
99 try tryOnErrorUnionImpl();
10 comptime try tryOnErrorUnionImpl();
10 try comptime tryOnErrorUnionImpl();
1111}
1212
1313fn tryOnErrorUnionImpl() !void {
test/behavior/tuple.zig+7-7
......@@ -23,7 +23,7 @@ test "tuple concatenation" {
2323 }
2424 };
2525 try S.doTheTest();
26 comptime try S.doTheTest();
26 try comptime S.doTheTest();
2727}
2828
2929test "tuple multiplication" {
......@@ -46,7 +46,7 @@ test "tuple multiplication" {
4646 }
4747 };
4848 try S.doTheTest();
49 comptime try S.doTheTest();
49 try comptime S.doTheTest();
5050}
5151
5252test "more tuple concatenation" {
......@@ -91,7 +91,7 @@ test "more tuple concatenation" {
9191 };
9292
9393 try T.doTheTest();
94 comptime try T.doTheTest();
94 try comptime T.doTheTest();
9595}
9696
9797test "pass tuple to comptime var parameter" {
......@@ -105,7 +105,7 @@ test "pass tuple to comptime var parameter" {
105105 }
106106 };
107107 try S.doTheTest();
108 comptime try S.doTheTest();
108 try comptime S.doTheTest();
109109}
110110
111111test "tuple initializer for var" {
......@@ -163,7 +163,7 @@ test "array-like initializer for tuple types" {
163163 };
164164
165165 try S.doTheTest();
166 comptime try S.doTheTest();
166 try comptime S.doTheTest();
167167}
168168
169169test "anon struct as the result from a labeled block" {
......@@ -180,7 +180,7 @@ test "anon struct as the result from a labeled block" {
180180 };
181181
182182 try S.doTheTest();
183 comptime try S.doTheTest();
183 try comptime S.doTheTest();
184184}
185185
186186test "tuple as the result from a labeled block" {
......@@ -195,7 +195,7 @@ test "tuple as the result from a labeled block" {
195195 };
196196
197197 try S.doTheTest();
198 comptime try S.doTheTest();
198 try comptime S.doTheTest();
199199}
200200
201201test "initializing tuple with explicit type" {
test/behavior/type_info.zig+20-20
......@@ -10,7 +10,7 @@ const expectEqualStrings = std.testing.expectEqualStrings;
1010
1111test "type info: integer, floating point type info" {
1212 try testIntFloat();
13 comptime try testIntFloat();
13 try comptime testIntFloat();
1414}
1515
1616fn testIntFloat() !void {
......@@ -26,7 +26,7 @@ fn testIntFloat() !void {
2626
2727test "type info: optional type info" {
2828 try testOptional();
29 comptime try testOptional();
29 try comptime testOptional();
3030}
3131
3232fn testOptional() !void {
......@@ -37,7 +37,7 @@ fn testOptional() !void {
3737
3838test "type info: C pointer type info" {
3939 try testCPtr();
40 comptime try testCPtr();
40 try comptime testCPtr();
4141}
4242
4343fn testCPtr() !void {
......@@ -60,7 +60,7 @@ test "type info: value is correctly copied" {
6060
6161test "type info: tag type, void info" {
6262 try testBasic();
63 comptime try testBasic();
63 try comptime testBasic();
6464}
6565
6666fn testBasic() !void {
......@@ -72,7 +72,7 @@ fn testBasic() !void {
7272
7373test "type info: pointer type info" {
7474 try testPointer();
75 comptime try testPointer();
75 try comptime testPointer();
7676}
7777
7878fn testPointer() !void {
......@@ -88,7 +88,7 @@ fn testPointer() !void {
8888
8989test "type info: unknown length pointer type info" {
9090 try testUnknownLenPtr();
91 comptime try testUnknownLenPtr();
91 try comptime testUnknownLenPtr();
9292}
9393
9494fn testUnknownLenPtr() !void {
......@@ -104,7 +104,7 @@ fn testUnknownLenPtr() !void {
104104
105105test "type info: null terminated pointer type info" {
106106 try testNullTerminatedPtr();
107 comptime try testNullTerminatedPtr();
107 try comptime testNullTerminatedPtr();
108108}
109109
110110fn testNullTerminatedPtr() !void {
......@@ -120,7 +120,7 @@ fn testNullTerminatedPtr() !void {
120120
121121test "type info: slice type info" {
122122 try testSlice();
123 comptime try testSlice();
123 try comptime testSlice();
124124}
125125
126126fn testSlice() !void {
......@@ -135,7 +135,7 @@ fn testSlice() !void {
135135
136136test "type info: array type info" {
137137 try testArray();
138 comptime try testArray();
138 try comptime testArray();
139139}
140140
141141fn testArray() !void {
......@@ -163,7 +163,7 @@ test "type info: error set, error union info, anyerror" {
163163 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
164164
165165 try testErrorSet();
166 comptime try testErrorSet();
166 try comptime testErrorSet();
167167}
168168
169169fn testErrorSet() !void {
......@@ -225,7 +225,7 @@ test "type info: enum info" {
225225 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
226226
227227 try testEnum();
228 comptime try testEnum();
228 try comptime testEnum();
229229}
230230
231231fn testEnum() !void {
......@@ -247,7 +247,7 @@ fn testEnum() !void {
247247
248248test "type info: union info" {
249249 try testUnion();
250 comptime try testUnion();
250 try comptime testUnion();
251251}
252252
253253fn testUnion() !void {
......@@ -257,7 +257,7 @@ fn testUnion() !void {
257257 try expect(typeinfo_info.Union.tag_type.? == TypeId);
258258 try expect(typeinfo_info.Union.fields.len == 24);
259259 try expect(typeinfo_info.Union.fields[4].type == @TypeOf(@typeInfo(u8).Int));
260 try expect(typeinfo_info.Union.decls.len == 22);
260 try expect(typeinfo_info.Union.decls.len == 21);
261261
262262 const TestNoTagUnion = union {
263263 Foo: void,
......@@ -287,7 +287,7 @@ test "type info: struct info" {
287287 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
288288
289289 try testStruct();
290 comptime try testStruct();
290 try comptime testStruct();
291291}
292292
293293fn testStruct() !void {
......@@ -306,7 +306,7 @@ const TestStruct = struct {
306306
307307test "type info: packed struct info" {
308308 try testPackedStruct();
309 comptime try testPackedStruct();
309 try comptime testPackedStruct();
310310}
311311
312312fn testPackedStruct() !void {
......@@ -339,7 +339,7 @@ const TestPackedStruct = packed struct {
339339
340340test "type info: opaque info" {
341341 try testOpaque();
342 comptime try testOpaque();
342 try comptime testOpaque();
343343}
344344
345345fn testOpaque() !void {
......@@ -356,7 +356,7 @@ test "type info: function type info" {
356356 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
357357
358358 try testFunction();
359 comptime try testFunction();
359 try comptime testFunction();
360360}
361361
362362fn testFunction() !void {
......@@ -427,7 +427,7 @@ test "typeInfo with comptime parameter in struct fn def" {
427427
428428test "type info: vectors" {
429429 try testVector();
430 comptime try testVector();
430 try comptime testVector();
431431}
432432
433433fn testVector() !void {
......@@ -444,7 +444,7 @@ test "type info: anyframe and anyframe->T" {
444444 }
445445
446446 try testAnyFrame();
447 comptime try testAnyFrame();
447 try comptime testAnyFrame();
448448}
449449
450450fn testAnyFrame() !void {
......@@ -489,7 +489,7 @@ test "@typeInfo does not force declarations into existence" {
489489 @compileError("test failed");
490490 }
491491 };
492 comptime try expect(@typeInfo(S).Struct.fields.len == 1);
492 try comptime expect(@typeInfo(S).Struct.fields.len == 1);
493493}
494494
495495fn add(a: i32, b: i32) i32 {
test/behavior/union.zig+28-28
......@@ -113,7 +113,7 @@ const ExternPtrOrInt = extern union {
113113 int: u64,
114114};
115115test "extern union size" {
116 comptime try expect(@sizeOf(ExternPtrOrInt) == 8);
116 try comptime expect(@sizeOf(ExternPtrOrInt) == 8);
117117}
118118
119119test "0-sized extern union definition" {
......@@ -165,7 +165,7 @@ test "access a member of tagged union with conflicting enum tag name" {
165165 const B = void;
166166 };
167167
168 comptime try expect(Bar.A == u8);
168 try comptime expect(Bar.A == u8);
169169}
170170
171171test "constant tagged union with payload" {
......@@ -225,7 +225,7 @@ test "union with specified enum tag" {
225225 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
226226
227227 try doTest();
228 comptime try doTest();
228 try comptime doTest();
229229}
230230
231231test "packed union generates correctly aligned type" {
......@@ -274,7 +274,7 @@ test "comparison between union and enum literal" {
274274 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
275275
276276 try testComparison();
277 comptime try testComparison();
277 try comptime testComparison();
278278}
279279
280280const TheTag = enum { A, B, C };
......@@ -289,7 +289,7 @@ test "cast union to tag type of union" {
289289 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
290290
291291 try testCastUnionToTag();
292 comptime try testCastUnionToTag();
292 try comptime testCastUnionToTag();
293293}
294294
295295fn testCastUnionToTag() !void {
......@@ -372,14 +372,14 @@ const PackedPtrOrInt = packed union {
372372 int: u64,
373373};
374374test "packed union size" {
375 comptime try expect(@sizeOf(PackedPtrOrInt) == 8);
375 try comptime expect(@sizeOf(PackedPtrOrInt) == 8);
376376}
377377
378378const ZeroBits = union {
379379 OnlyField: void,
380380};
381381test "union with only 1 field which is void should be zero bits" {
382 comptime try expect(@sizeOf(ZeroBits) == 0);
382 try comptime expect(@sizeOf(ZeroBits) == 0);
383383}
384384
385385test "tagged union initialization with runtime void" {
......@@ -430,7 +430,7 @@ test "union with only 1 field casted to its enum type" {
430430
431431 var e = Expr{ .Literal = Literal{ .Bool = true } };
432432 const ExprTag = Tag(Expr);
433 comptime try expect(Tag(ExprTag) == u0);
433 try comptime expect(Tag(ExprTag) == u0);
434434 var t = @as(ExprTag, e);
435435 try expect(t == Expr.Literal);
436436}
......@@ -439,7 +439,7 @@ test "union with one member defaults to u0 tag type" {
439439 const U0 = union(enum) {
440440 X: u32,
441441 };
442 comptime try expect(Tag(Tag(U0)) == u0);
442 try comptime expect(Tag(Tag(U0)) == u0);
443443}
444444
445445const Foo1 = union(enum) {
......@@ -547,7 +547,7 @@ test "method call on an empty union" {
547547 }
548548 };
549549 try S.doTheTest();
550 comptime try S.doTheTest();
550 try comptime S.doTheTest();
551551}
552552
553553const Point = struct {
......@@ -628,7 +628,7 @@ test "tagged union with all void fields but a meaningful tag" {
628628 }
629629 };
630630 try S.doTheTest();
631 comptime try S.doTheTest();
631 try comptime S.doTheTest();
632632}
633633
634634test "union(enum(u32)) with specified and unspecified tag values" {
......@@ -637,9 +637,9 @@ test "union(enum(u32)) with specified and unspecified tag values" {
637637 if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
638638 if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
639639
640 comptime try expect(Tag(Tag(MultipleChoice2)) == u32);
640 try comptime expect(Tag(Tag(MultipleChoice2)) == u32);
641641 try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 });
642 comptime try testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 });
642 try comptime testEnumWithSpecifiedAndUnspecifiedTagValues(MultipleChoice2{ .C = 123 });
643643}
644644
645645const MultipleChoice2 = union(enum(u32)) {
......@@ -718,11 +718,11 @@ test "union with only 1 field casted to its enum type which has enum value speci
718718 };
719719
720720 var e = Expr{ .Literal = Literal{ .Bool = true } };
721 comptime try expect(Tag(ExprTag) == comptime_int);
721 try comptime expect(Tag(ExprTag) == comptime_int);
722722 comptime var t = @as(ExprTag, e);
723723 try expect(t == Expr.Literal);
724724 try expect(@enumToInt(t) == 33);
725 comptime try expect(@enumToInt(t) == 33);
725 try comptime expect(@enumToInt(t) == 33);
726726}
727727
728728test "@enumToInt works on unions" {
......@@ -805,7 +805,7 @@ test "return union init with void payload" {
805805 }
806806 };
807807 try S.entry();
808 comptime try S.entry();
808 try comptime S.entry();
809809}
810810
811811test "@unionInit stored to a const" {
......@@ -833,7 +833,7 @@ test "@unionInit stored to a const" {
833833 }
834834 };
835835
836 comptime try S.doTheTest();
836 try comptime S.doTheTest();
837837 try S.doTheTest();
838838}
839839
......@@ -905,7 +905,7 @@ test "union with comptime_int tag" {
905905 Y: u16,
906906 Z: u8,
907907 };
908 comptime try expect(Tag(Tag(Union)) == comptime_int);
908 try comptime expect(Tag(Tag(Union)) == comptime_int);
909909}
910910
911911test "extern union doesn't trigger field check at comptime" {
......@@ -915,7 +915,7 @@ test "extern union doesn't trigger field check at comptime" {
915915 };
916916
917917 const x = U{ .x = 0x55AAAA55 };
918 comptime try expect(x.y == 0x55);
918 try comptime expect(x.y == 0x55);
919919}
920920
921921test "anonymous union literal syntax" {
......@@ -942,7 +942,7 @@ test "anonymous union literal syntax" {
942942 }
943943 };
944944 try S.doTheTest();
945 comptime try S.doTheTest();
945 try comptime S.doTheTest();
946946}
947947
948948test "function call result coerces from tagged union to the tag" {
......@@ -975,7 +975,7 @@ test "function call result coerces from tagged union to the tag" {
975975 }
976976 };
977977 try S.doTheTest();
978 comptime try S.doTheTest();
978 try comptime S.doTheTest();
979979}
980980
981981test "cast from anonymous struct to union" {
......@@ -1007,7 +1007,7 @@ test "cast from anonymous struct to union" {
10071007 }
10081008 };
10091009 try S.doTheTest();
1010 comptime try S.doTheTest();
1010 try comptime S.doTheTest();
10111011}
10121012
10131013test "cast from pointer to anonymous struct to pointer to union" {
......@@ -1039,7 +1039,7 @@ test "cast from pointer to anonymous struct to pointer to union" {
10391039 }
10401040 };
10411041 try S.doTheTest();
1042 comptime try S.doTheTest();
1042 try comptime S.doTheTest();
10431043}
10441044
10451045test "switching on non exhaustive union" {
......@@ -1067,7 +1067,7 @@ test "switching on non exhaustive union" {
10671067 }
10681068 };
10691069 try S.doTheTest();
1070 comptime try S.doTheTest();
1070 try comptime S.doTheTest();
10711071}
10721072
10731073test "containers with single-field enums" {
......@@ -1096,7 +1096,7 @@ test "containers with single-field enums" {
10961096 };
10971097
10981098 try S.doTheTest();
1099 comptime try S.doTheTest();
1099 try comptime S.doTheTest();
11001100}
11011101
11021102test "@unionInit on union with tag but no fields" {
......@@ -1130,7 +1130,7 @@ test "@unionInit on union with tag but no fields" {
11301130 };
11311131
11321132 try S.doTheTest();
1133 comptime try S.doTheTest();
1133 try comptime S.doTheTest();
11341134}
11351135
11361136test "union enum type gets a separate scope" {
......@@ -1552,7 +1552,7 @@ test "reinterpreting enum value inside packed union" {
15521552 }
15531553 };
15541554 try U.doTest();
1555 comptime try U.doTest();
1555 try comptime U.doTest();
15561556}
15571557
15581558test "access the tag of a global tagged union" {
......@@ -1581,5 +1581,5 @@ test "coerce enum literal to union in result loc" {
15811581 }
15821582 };
15831583 try U.doTest(true);
1584 comptime try U.doTest(true);
1584 try comptime U.doTest(true);
15851585}
test/behavior/usingnamespace.zig+1-1
......@@ -32,7 +32,7 @@ usingnamespace struct {
3232};
3333
3434test "usingnamespace does not redeclare an imported variable" {
35 comptime try std.testing.expect(@This().foo == 42);
35 try comptime std.testing.expect(@This().foo == 42);
3636}
3737
3838usingnamespace @import("usingnamespace/foo.zig");
test/behavior/vector.zig+34-34
......@@ -21,7 +21,7 @@ test "implicit cast vector to array - bool" {
2121 }
2222 };
2323 try S.doTheTest();
24 comptime try S.doTheTest();
24 try comptime S.doTheTest();
2525}
2626
2727test "vector wrap operators" {
......@@ -45,7 +45,7 @@ test "vector wrap operators" {
4545 }
4646 };
4747 try S.doTheTest();
48 comptime try S.doTheTest();
48 try comptime S.doTheTest();
4949}
5050
5151test "vector bin compares with mem.eql" {
......@@ -69,7 +69,7 @@ test "vector bin compares with mem.eql" {
6969 }
7070 };
7171 try S.doTheTest();
72 comptime try S.doTheTest();
72 try comptime S.doTheTest();
7373}
7474
7575test "vector int operators" {
......@@ -91,7 +91,7 @@ test "vector int operators" {
9191 }
9292 };
9393 try S.doTheTest();
94 comptime try S.doTheTest();
94 try comptime S.doTheTest();
9595}
9696
9797test "vector float operators" {
......@@ -114,7 +114,7 @@ test "vector float operators" {
114114 }
115115 };
116116 try S.doTheTest();
117 comptime try S.doTheTest();
117 try comptime S.doTheTest();
118118 }
119119}
120120
......@@ -135,7 +135,7 @@ test "vector bit operators" {
135135 }
136136 };
137137 try S.doTheTest();
138 comptime try S.doTheTest();
138 try comptime S.doTheTest();
139139}
140140
141141test "implicit cast vector to array" {
......@@ -153,7 +153,7 @@ test "implicit cast vector to array" {
153153 }
154154 };
155155 try S.doTheTest();
156 comptime try S.doTheTest();
156 try comptime S.doTheTest();
157157}
158158
159159test "array to vector" {
......@@ -171,7 +171,7 @@ test "array to vector" {
171171 }
172172 };
173173 try S.doTheTest();
174 comptime try S.doTheTest();
174 try comptime S.doTheTest();
175175}
176176
177177test "array to vector with element type coercion" {
......@@ -192,7 +192,7 @@ test "array to vector with element type coercion" {
192192 }
193193 };
194194 try S.doTheTest();
195 comptime try S.doTheTest();
195 try comptime S.doTheTest();
196196}
197197
198198test "peer type resolution with coercible element types" {
......@@ -212,7 +212,7 @@ test "peer type resolution with coercible element types" {
212212 try std.testing.expect(@TypeOf(c) == @Vector(2, u16));
213213 }
214214 };
215 comptime try S.doTheTest();
215 try comptime S.doTheTest();
216216}
217217
218218test "tuple to vector" {
......@@ -242,7 +242,7 @@ test "tuple to vector" {
242242 }
243243 };
244244 try S.doTheTest();
245 comptime try S.doTheTest();
245 try comptime S.doTheTest();
246246}
247247
248248test "vector casts of sizes not divisible by 8" {
......@@ -278,7 +278,7 @@ test "vector casts of sizes not divisible by 8" {
278278 }
279279 };
280280 try S.doTheTest();
281 comptime try S.doTheTest();
281 try comptime S.doTheTest();
282282}
283283
284284test "vector @splat" {
......@@ -326,7 +326,7 @@ test "vector @splat" {
326326 }
327327 };
328328 try S.doTheTest();
329 comptime try S.doTheTest();
329 try comptime S.doTheTest();
330330}
331331
332332test "load vector elements via comptime index" {
......@@ -348,7 +348,7 @@ test "load vector elements via comptime index" {
348348 };
349349
350350 try S.doTheTest();
351 comptime try S.doTheTest();
351 try comptime S.doTheTest();
352352}
353353
354354test "store vector elements via comptime index" {
......@@ -376,7 +376,7 @@ test "store vector elements via comptime index" {
376376 };
377377
378378 try S.doTheTest();
379 comptime try S.doTheTest();
379 try comptime S.doTheTest();
380380}
381381
382382test "load vector elements via runtime index" {
......@@ -398,7 +398,7 @@ test "load vector elements via runtime index" {
398398 };
399399
400400 try S.doTheTest();
401 comptime try S.doTheTest();
401 try comptime S.doTheTest();
402402}
403403
404404test "store vector elements via runtime index" {
......@@ -421,7 +421,7 @@ test "store vector elements via runtime index" {
421421 };
422422
423423 try S.doTheTest();
424 comptime try S.doTheTest();
424 try comptime S.doTheTest();
425425}
426426
427427test "initialize vector which is a struct field" {
......@@ -443,7 +443,7 @@ test "initialize vector which is a struct field" {
443443 }
444444 };
445445 try S.doTheTest();
446 comptime try S.doTheTest();
446 try comptime S.doTheTest();
447447}
448448
449449test "vector comparison operators" {
......@@ -484,7 +484,7 @@ test "vector comparison operators" {
484484 }
485485 };
486486 try S.doTheTest();
487 comptime try S.doTheTest();
487 try comptime S.doTheTest();
488488}
489489
490490test "vector division operators" {
......@@ -567,7 +567,7 @@ test "vector division operators" {
567567 };
568568
569569 try S.doTheTest();
570 comptime try S.doTheTest();
570 try comptime S.doTheTest();
571571}
572572
573573test "vector bitwise not operator" {
......@@ -599,7 +599,7 @@ test "vector bitwise not operator" {
599599 };
600600
601601 try S.doTheTest();
602 comptime try S.doTheTest();
602 try comptime S.doTheTest();
603603}
604604
605605test "vector shift operators" {
......@@ -693,7 +693,7 @@ test "vector shift operators" {
693693 }
694694
695695 try S.doTheTest();
696 comptime try S.doTheTest();
696 try comptime S.doTheTest();
697697}
698698
699699test "vector reduce operation" {
......@@ -837,7 +837,7 @@ test "vector reduce operation" {
837837 };
838838
839839 try S.doTheTest();
840 comptime try S.doTheTest();
840 try comptime S.doTheTest();
841841}
842842
843843test "vector @reduce comptime" {
......@@ -849,9 +849,9 @@ test "vector @reduce comptime" {
849849 const value = @Vector(4, i32){ 1, -1, 1, -1 };
850850 const result = value > @splat(4, @as(i32, 0));
851851 // result is { true, false, true, false };
852 comptime try expect(@TypeOf(result) == @Vector(4, bool));
852 try comptime expect(@TypeOf(result) == @Vector(4, bool));
853853 const is_all_true = @reduce(.And, result);
854 comptime try expect(@TypeOf(is_all_true) == bool);
854 try comptime expect(@TypeOf(is_all_true) == bool);
855855 try expect(is_all_true == false);
856856}
857857
......@@ -903,7 +903,7 @@ test "saturating add" {
903903 }
904904 };
905905 try S.doTheTest();
906 comptime try S.doTheTest();
906 try comptime S.doTheTest();
907907}
908908
909909test "saturating subtraction" {
......@@ -926,7 +926,7 @@ test "saturating subtraction" {
926926 }
927927 };
928928 try S.doTheTest();
929 comptime try S.doTheTest();
929 try comptime S.doTheTest();
930930}
931931
932932test "saturating multiplication" {
......@@ -953,7 +953,7 @@ test "saturating multiplication" {
953953 };
954954
955955 try S.doTheTest();
956 comptime try S.doTheTest();
956 try comptime S.doTheTest();
957957}
958958
959959test "saturating shift-left" {
......@@ -976,7 +976,7 @@ test "saturating shift-left" {
976976 }
977977 };
978978 try S.doTheTest();
979 comptime try S.doTheTest();
979 try comptime S.doTheTest();
980980}
981981
982982test "multiplication-assignment operator with an array operand" {
......@@ -997,7 +997,7 @@ test "multiplication-assignment operator with an array operand" {
997997 }
998998 };
999999 try S.doTheTest();
1000 comptime try S.doTheTest();
1000 try comptime S.doTheTest();
10011001}
10021002
10031003test "@addWithOverflow" {
......@@ -1041,7 +1041,7 @@ test "@addWithOverflow" {
10411041 }
10421042 };
10431043 try S.doTheTest();
1044 comptime try S.doTheTest();
1044 try comptime S.doTheTest();
10451045}
10461046
10471047test "@subWithOverflow" {
......@@ -1071,7 +1071,7 @@ test "@subWithOverflow" {
10711071 }
10721072 };
10731073 try S.doTheTest();
1074 comptime try S.doTheTest();
1074 try comptime S.doTheTest();
10751075}
10761076
10771077test "@mulWithOverflow" {
......@@ -1092,7 +1092,7 @@ test "@mulWithOverflow" {
10921092 }
10931093 };
10941094 try S.doTheTest();
1095 comptime try S.doTheTest();
1095 try comptime S.doTheTest();
10961096}
10971097
10981098test "@shlWithOverflow" {
......@@ -1113,7 +1113,7 @@ test "@shlWithOverflow" {
11131113 }
11141114 };
11151115 try S.doTheTest();
1116 comptime try S.doTheTest();
1116 try comptime S.doTheTest();
11171117}
11181118
11191119test "alignment of vectors" {
test/behavior/while.zig+4-4
......@@ -122,7 +122,7 @@ test "while copies its payload" {
122122 }
123123 };
124124 try S.doTheTest();
125 comptime try S.doTheTest();
125 try comptime S.doTheTest();
126126}
127127
128128test "continue and break" {
......@@ -293,7 +293,7 @@ test "while bool 2 break statements and an else" {
293293 }
294294 };
295295 try S.entry(true, false);
296 comptime try S.entry(true, false);
296 try comptime S.entry(true, false);
297297}
298298
299299test "while optional 2 break statements and an else" {
......@@ -312,7 +312,7 @@ test "while optional 2 break statements and an else" {
312312 }
313313 };
314314 try S.entry(true, false);
315 comptime try S.entry(true, false);
315 try comptime S.entry(true, false);
316316}
317317
318318test "while error 2 break statements and an else" {
......@@ -332,7 +332,7 @@ test "while error 2 break statements and an else" {
332332 }
333333 };
334334 try S.entry(true, false);
335 comptime try S.entry(true, false);
335 try comptime S.entry(true, false);
336336}
337337
338338test "continue inline while loop" {
test/behavior/wrapping_arithmetic.zig+15-15
......@@ -31,12 +31,12 @@ test "wrapping add" {
3131 };
3232
3333 try S.doTheTest();
34 comptime try S.doTheTest();
34 try comptime S.doTheTest();
3535
36 comptime try S.testWrapAdd(comptime_int, 0, 0, 0);
37 comptime try S.testWrapAdd(comptime_int, 3, 2, 5);
38 comptime try S.testWrapAdd(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 1119305249183743626545271163355074748512);
39 comptime try S.testWrapAdd(comptime_int, 7, -593423721213448152027139550640105366508, -593423721213448152027139550640105366501);
36 try comptime S.testWrapAdd(comptime_int, 0, 0, 0);
37 try comptime S.testWrapAdd(comptime_int, 3, 2, 5);
38 try comptime S.testWrapAdd(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 1119305249183743626545271163355074748512);
39 try comptime S.testWrapAdd(comptime_int, 7, -593423721213448152027139550640105366508, -593423721213448152027139550640105366501);
4040}
4141
4242test "wrapping subtraction" {
......@@ -64,12 +64,12 @@ test "wrapping subtraction" {
6464 };
6565
6666 try S.doTheTest();
67 comptime try S.doTheTest();
67 try comptime S.doTheTest();
6868
69 comptime try S.testWrapSub(comptime_int, 0, 0, 0);
70 comptime try S.testWrapSub(comptime_int, 3, 2, 1);
71 comptime try S.testWrapSub(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 182846383813587550256162760261375991602);
72 comptime try S.testWrapSub(comptime_int, 7, -593423721213448152027139550640105366508, 593423721213448152027139550640105366515);
69 try comptime S.testWrapSub(comptime_int, 0, 0, 0);
70 try comptime S.testWrapSub(comptime_int, 3, 2, 1);
71 try comptime S.testWrapSub(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 182846383813587550256162760261375991602);
72 try comptime S.testWrapSub(comptime_int, 7, -593423721213448152027139550640105366508, 593423721213448152027139550640105366515);
7373}
7474
7575test "wrapping multiplication" {
......@@ -101,10 +101,10 @@ test "wrapping multiplication" {
101101 };
102102
103103 try S.doTheTest();
104 comptime try S.doTheTest();
104 try comptime S.doTheTest();
105105
106 comptime try S.testWrapMul(comptime_int, 0, 0, 0);
107 comptime try S.testWrapMul(comptime_int, 3, 2, 6);
108 comptime try S.testWrapMul(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 304852860194144160265083087140337419215516305999637969803722975979232817921935);
109 comptime try S.testWrapMul(comptime_int, 7, -593423721213448152027139550640105366508, -4153966048494137064189976854480737565556);
106 try comptime S.testWrapMul(comptime_int, 0, 0, 0);
107 try comptime S.testWrapMul(comptime_int, 3, 2, 6);
108 try comptime S.testWrapMul(comptime_int, 651075816498665588400716961808225370057, 468229432685078038144554201546849378455, 304852860194144160265083087140337419215516305999637969803722975979232817921935);
109 try comptime S.testWrapMul(comptime_int, 7, -593423721213448152027139550640105366508, -4153966048494137064189976854480737565556);
110110}
test/cases/compile_errors/Issue_5586_Make_unary_minus_for_unsigned_types_a_compile_error.zig+2-3
......@@ -2,8 +2,7 @@ export fn f1(x: u32) u32 {
22 const y = -%x;
33 return -y;
44}
5const V = @import("std").meta.Vector;
6export fn f2(x: V(4, u32)) V(4, u32) {
5export fn f2(x: @Vector(4, u32)) @Vector(4, u32) {
76 const y = -%x;
87 return -y;
98}
......@@ -13,4 +12,4 @@ export fn f2(x: V(4, u32)) V(4, u32) {
1312// target=native
1413//
1514// :3:12: error: negation of type 'u32'
16// :8:12: error: negation of type '@Vector(4, u32)'
15// :7:12: error: negation of type '@Vector(4, u32)'
test/cases/compile_errors/comptime_vector_overflow_shows_the_index.zig+2-2
......@@ -1,6 +1,6 @@
11comptime {
2 var a: @import("std").meta.Vector(4, u8) = [_]u8{ 1, 2, 255, 4 };
3 var b: @import("std").meta.Vector(4, u8) = [_]u8{ 5, 6, 1, 8 };
2 var a: @Vector(4, u8) = [_]u8{ 1, 2, 255, 4 };
3 var b: @Vector(4, u8) = [_]u8{ 5, 6, 1, 8 };
44 var x = a + b;
55 _ = x;
66}
test/cases/compile_errors/nested_vectors.zig+1-1
......@@ -1,5 +1,5 @@
11export fn entry() void {
2 const V1 = @import("std").meta.Vector(4, u8);
2 const V1 = @Vector(4, u8);
33 const V2 = @Type(.{ .Vector = .{ .len = 4, .child = V1 } });
44 var v: V2 = undefined;
55 _ = v;
test/cases/compile_errors/shuffle_with_selected_index_past_first_vector_length.zig+2-2
......@@ -1,6 +1,6 @@
11export fn entry() void {
2 const v: @import("std").meta.Vector(4, u32) = [4]u32{ 10, 11, 12, 13 };
3 const x: @import("std").meta.Vector(4, u32) = [4]u32{ 14, 15, 16, 17 };
2 const v: @Vector(4, u32) = [4]u32{ 10, 11, 12, 13 };
3 const x: @Vector(4, u32) = [4]u32{ 14, 15, 16, 17 };
44 var z = @shuffle(u32, v, x, [8]i32{ 0, 1, 2, 3, 7, 6, 5, 4 });
55 _ = z;
66}
test/cases/compile_errors/vector_index_out_of_bounds.zig+2-2
......@@ -1,5 +1,5 @@
11export fn entry() void {
2 const x = @import("std").meta.Vector(3, f32){ 25, 75, 5, 0 };
2 const x = @Vector(3, f32){ 25, 75, 5, 0 };
33 _ = x;
44}
55
......@@ -7,4 +7,4 @@ export fn entry() void {
77// backend=stage2
88// target=native
99//
10// :2:49: error: expected 3 vector elements; found 4
10// :2:30: error: expected 3 vector elements; found 4
test/standalone/issue_794/main.zig+1-1
......@@ -3,5 +3,5 @@ const std = @import("std");
33const testing = std.testing;
44
55test "c import" {
6 comptime try testing.expect(c.NUMBER == 1234);
6 try comptime testing.expect(c.NUMBER == 1234);
77}