authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-06-13 22:27:27+03:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-06-14 00:16:40+03:00
loge63ff4f1c110165c4b92025cb5b9d5531e861643
tree277384b63ba8398200de8e9adc36110597f4470b
parentb9f07b7ac227134001258e5933e3ef61aae80303

add ast-check flag to zig fmt, fix found bugs


29 files changed, 803 insertions(+), 547 deletions(-)

ci/azure/linux_script+1-1
......@@ -60,7 +60,7 @@ unset CXX
6060make $JOBS install
6161
6262# look for formatting errors
63release/bin/zig fmt --check .. || (echo "Please run 'zig fmt' to fix the non-conforming files listed above." && false)
63release/bin/zig fmt --check --ast-check .. || (echo "Please run 'zig fmt' to fix the non-conforming files listed above." && false)
6464
6565# Here we rebuild zig but this time using the Zig binary we just now produced to
6666# build zig1.o rather than relying on the one built with stage0. See
lib/std/fmt/parse_float.zig+14-1
......@@ -34,7 +34,7 @@
3434// - Only supports round-to-zero
3535// - Does not handle denormals
3636
37const std = @import("../std.zig");
37const std = @import("std");
3838const ascii = std.ascii;
3939
4040// The mantissa field in FloatRepr is 64bit wide and holds only 19 digits
......@@ -231,6 +231,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
231231 } else if (c == '.') {
232232 i += 1;
233233 state = .LeadingFractionalZeros;
234 } else if (c == '_') {
235 i += 1;
234236 } else {
235237 state = .MantissaIntegral;
236238 }
......@@ -259,6 +261,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
259261 } else if (c == '.') {
260262 i += 1;
261263 state = .MantissaFractional;
264 } else if (c == '_') {
265 i += 1;
262266 } else {
263267 state = .MantissaFractional;
264268 }
......@@ -276,6 +280,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
276280 } else if (c == 'e' or c == 'E') {
277281 i += 1;
278282 state = .ExponentSign;
283 } else if (c == '_') {
284 i += 1;
279285 } else {
280286 state = .ExponentSign;
281287 }
......@@ -283,6 +289,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
283289 .ExponentSign => {
284290 if (c == '+') {
285291 i += 1;
292 } else if (c == '_') {
293 return error.InvalidCharacter;
286294 } else if (c == '-') {
287295 negative_exp = true;
288296 i += 1;
......@@ -293,6 +301,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
293301 .LeadingExponentZeros => {
294302 if (c == '0') {
295303 i += 1;
304 } else if (c == '_') {
305 i += 1;
296306 } else {
297307 state = .Exponent;
298308 }
......@@ -304,6 +314,8 @@ fn parseRepr(s: []const u8, n: *FloatRepr) !ParseResult {
304314 exponent += @intCast(i32, c - '0');
305315 }
306316
317 i += 1;
318 } else if (c == '_') {
307319 i += 1;
308320 } else {
309321 return error.InvalidCharacter;
......@@ -405,6 +417,7 @@ test "fmt.parseFloat" {
405417 try expectEqual(try parseFloat(T, "-INF"), -std.math.inf(T));
406418
407419 try expectEqual(try parseFloat(T, "0.4e0066999999999999999999999999999999999999999999999999999"), std.math.inf(T));
420 try expect(approxEqAbs(T, try parseFloat(T, "0_1_2_3_4_5_6.7_8_9_0_0_0e0_0_1_0"), @as(T, 123456.789000e10), epsilon));
408421
409422 if (T != f16) {
410423 try expect(approxEqAbs(T, try parseFloat(T, "1e-2"), 0.01, epsilon));
lib/std/special/compiler_rt.zig+523-308
......@@ -20,10 +20,13 @@ comptime {
2020 switch (arch) {
2121 .i386,
2222 .x86_64,
23 => @export(@import("compiler_rt/stack_probe.zig").zig_probe_stack, .{
24 .name = "__zig_probe_stack",
25 .linkage = linkage,
26 }),
23 => {
24 const zig_probe_stack = @import("compiler_rt/stack_probe.zig").zig_probe_stack;
25 @export(zig_probe_stack, .{
26 .name = "__zig_probe_stack",
27 .linkage = linkage,
28 });
29 },
2730
2831 else => {},
2932 }
......@@ -31,355 +34,567 @@ comptime {
3134 // __clear_cache manages its own logic about whether to be exported or not.
3235 _ = @import("compiler_rt/clear_cache.zig").clear_cache;
3336
34 @export(@import("compiler_rt/compareXf2.zig").__lesf2, .{ .name = "__lesf2", .linkage = linkage });
35 @export(@import("compiler_rt/compareXf2.zig").__ledf2, .{ .name = "__ledf2", .linkage = linkage });
36 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__letf2", .linkage = linkage });
37 const __lesf2 = @import("compiler_rt/compareXf2.zig").__lesf2;
38 @export(__lesf2, .{ .name = "__lesf2", .linkage = linkage });
39 const __ledf2 = @import("compiler_rt/compareXf2.zig").__ledf2;
40 @export(__ledf2, .{ .name = "__ledf2", .linkage = linkage });
41 const __letf2 = @import("compiler_rt/compareXf2.zig").__letf2;
42 @export(__letf2, .{ .name = "__letf2", .linkage = linkage });
3743
38 @export(@import("compiler_rt/compareXf2.zig").__gesf2, .{ .name = "__gesf2", .linkage = linkage });
39 @export(@import("compiler_rt/compareXf2.zig").__gedf2, .{ .name = "__gedf2", .linkage = linkage });
40 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__getf2", .linkage = linkage });
44 const __gesf2 = @import("compiler_rt/compareXf2.zig").__gesf2;
45 @export(__gesf2, .{ .name = "__gesf2", .linkage = linkage });
46 const __gedf2 = @import("compiler_rt/compareXf2.zig").__gedf2;
47 @export(__gedf2, .{ .name = "__gedf2", .linkage = linkage });
48 const __getf2 = @import("compiler_rt/compareXf2.zig").__getf2;
49 @export(__getf2, .{ .name = "__getf2", .linkage = linkage });
4150
4251 if (!is_test) {
43 @export(@import("compiler_rt/compareXf2.zig").__lesf2, .{ .name = "__cmpsf2", .linkage = linkage });
44 @export(@import("compiler_rt/compareXf2.zig").__ledf2, .{ .name = "__cmpdf2", .linkage = linkage });
45 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__cmptf2", .linkage = linkage });
46
47 @export(@import("compiler_rt/compareXf2.zig").__eqsf2, .{ .name = "__eqsf2", .linkage = linkage });
48 @export(@import("compiler_rt/compareXf2.zig").__eqdf2, .{ .name = "__eqdf2", .linkage = linkage });
49 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__eqtf2", .linkage = linkage });
50
51 @export(@import("compiler_rt/compareXf2.zig").__ltsf2, .{ .name = "__ltsf2", .linkage = linkage });
52 @export(@import("compiler_rt/compareXf2.zig").__ltdf2, .{ .name = "__ltdf2", .linkage = linkage });
53 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__lttf2", .linkage = linkage });
54
55 @export(@import("compiler_rt/compareXf2.zig").__nesf2, .{ .name = "__nesf2", .linkage = linkage });
56 @export(@import("compiler_rt/compareXf2.zig").__nedf2, .{ .name = "__nedf2", .linkage = linkage });
57 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__netf2", .linkage = linkage });
58
59 @export(@import("compiler_rt/compareXf2.zig").__gtsf2, .{ .name = "__gtsf2", .linkage = linkage });
60 @export(@import("compiler_rt/compareXf2.zig").__gtdf2, .{ .name = "__gtdf2", .linkage = linkage });
61 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__gttf2", .linkage = linkage });
62
63 @export(@import("compiler_rt/extendXfYf2.zig").__extendhfsf2, .{ .name = "__gnu_h2f_ieee", .linkage = linkage });
64 @export(@import("compiler_rt/truncXfYf2.zig").__truncsfhf2, .{ .name = "__gnu_f2h_ieee", .linkage = linkage });
52 @export(__lesf2, .{ .name = "__cmpsf2", .linkage = linkage });
53 @export(__ledf2, .{ .name = "__cmpdf2", .linkage = linkage });
54 @export(__letf2, .{ .name = "__cmptf2", .linkage = linkage });
55
56 const __eqsf2 = @import("compiler_rt/compareXf2.zig").__eqsf2;
57 @export(__eqsf2, .{ .name = "__eqsf2", .linkage = linkage });
58 const __eqdf2 = @import("compiler_rt/compareXf2.zig").__eqdf2;
59 @export(__eqdf2, .{ .name = "__eqdf2", .linkage = linkage });
60 @export(__letf2, .{ .name = "__eqtf2", .linkage = linkage });
61
62 const __ltsf2 = @import("compiler_rt/compareXf2.zig").__ltsf2;
63 @export(__ltsf2, .{ .name = "__ltsf2", .linkage = linkage });
64 const __ltdf2 = @import("compiler_rt/compareXf2.zig").__ltdf2;
65 @export(__ltdf2, .{ .name = "__ltdf2", .linkage = linkage });
66 @export(__letf2, .{ .name = "__lttf2", .linkage = linkage });
67
68 const __nesf2 = @import("compiler_rt/compareXf2.zig").__nesf2;
69 @export(__nesf2, .{ .name = "__nesf2", .linkage = linkage });
70 const __nedf2 = @import("compiler_rt/compareXf2.zig").__nedf2;
71 @export(__nedf2, .{ .name = "__nedf2", .linkage = linkage });
72 @export(__letf2, .{ .name = "__netf2", .linkage = linkage });
73
74 const __gtsf2 = @import("compiler_rt/compareXf2.zig").__gtsf2;
75 @export(__gtsf2, .{ .name = "__gtsf2", .linkage = linkage });
76 const __gtdf2 = @import("compiler_rt/compareXf2.zig").__gtdf2;
77 @export(__gtdf2, .{ .name = "__gtdf2", .linkage = linkage });
78 @export(__getf2, .{ .name = "__gttf2", .linkage = linkage });
79
80 const __extendhfsf2 = @import("compiler_rt/extendXfYf2.zig").__extendhfsf2;
81 @export(__extendhfsf2, .{ .name = "__gnu_h2f_ieee", .linkage = linkage });
82 const __truncsfhf2 = @import("compiler_rt/truncXfYf2.zig").__truncsfhf2;
83 @export(__truncsfhf2, .{ .name = "__gnu_f2h_ieee", .linkage = linkage });
6584 }
6685
67 @export(@import("compiler_rt/compareXf2.zig").__unordsf2, .{ .name = "__unordsf2", .linkage = linkage });
68 @export(@import("compiler_rt/compareXf2.zig").__unorddf2, .{ .name = "__unorddf2", .linkage = linkage });
69 @export(@import("compiler_rt/compareXf2.zig").__unordtf2, .{ .name = "__unordtf2", .linkage = linkage });
70
71 @export(@import("compiler_rt/addXf3.zig").__addsf3, .{ .name = "__addsf3", .linkage = linkage });
72 @export(@import("compiler_rt/addXf3.zig").__adddf3, .{ .name = "__adddf3", .linkage = linkage });
73 @export(@import("compiler_rt/addXf3.zig").__addtf3, .{ .name = "__addtf3", .linkage = linkage });
74 @export(@import("compiler_rt/addXf3.zig").__subsf3, .{ .name = "__subsf3", .linkage = linkage });
75 @export(@import("compiler_rt/addXf3.zig").__subdf3, .{ .name = "__subdf3", .linkage = linkage });
76 @export(@import("compiler_rt/addXf3.zig").__subtf3, .{ .name = "__subtf3", .linkage = linkage });
77
78 @export(@import("compiler_rt/mulXf3.zig").__mulsf3, .{ .name = "__mulsf3", .linkage = linkage });
79 @export(@import("compiler_rt/mulXf3.zig").__muldf3, .{ .name = "__muldf3", .linkage = linkage });
80 @export(@import("compiler_rt/mulXf3.zig").__multf3, .{ .name = "__multf3", .linkage = linkage });
81
82 @export(@import("compiler_rt/divsf3.zig").__divsf3, .{ .name = "__divsf3", .linkage = linkage });
83 @export(@import("compiler_rt/divdf3.zig").__divdf3, .{ .name = "__divdf3", .linkage = linkage });
84 @export(@import("compiler_rt/divtf3.zig").__divtf3, .{ .name = "__divtf3", .linkage = linkage });
85
86 @export(@import("compiler_rt/shift.zig").__ashldi3, .{ .name = "__ashldi3", .linkage = linkage });
87 @export(@import("compiler_rt/shift.zig").__ashlti3, .{ .name = "__ashlti3", .linkage = linkage });
88 @export(@import("compiler_rt/shift.zig").__ashrdi3, .{ .name = "__ashrdi3", .linkage = linkage });
89 @export(@import("compiler_rt/shift.zig").__ashrti3, .{ .name = "__ashrti3", .linkage = linkage });
90 @export(@import("compiler_rt/shift.zig").__lshrdi3, .{ .name = "__lshrdi3", .linkage = linkage });
91 @export(@import("compiler_rt/shift.zig").__lshrti3, .{ .name = "__lshrti3", .linkage = linkage });
92
93 @export(@import("compiler_rt/floatsiXf.zig").__floatsidf, .{ .name = "__floatsidf", .linkage = linkage });
94 @export(@import("compiler_rt/floatsiXf.zig").__floatsisf, .{ .name = "__floatsisf", .linkage = linkage });
95 @export(@import("compiler_rt/floatdidf.zig").__floatdidf, .{ .name = "__floatdidf", .linkage = linkage });
96 @export(@import("compiler_rt/floatsiXf.zig").__floatsitf, .{ .name = "__floatsitf", .linkage = linkage });
97
98 @export(@import("compiler_rt/floatunsisf.zig").__floatunsisf, .{ .name = "__floatunsisf", .linkage = linkage });
99 @export(@import("compiler_rt/floatundisf.zig").__floatundisf, .{ .name = "__floatundisf", .linkage = linkage });
100 @export(@import("compiler_rt/floatunsidf.zig").__floatunsidf, .{ .name = "__floatunsidf", .linkage = linkage });
101 @export(@import("compiler_rt/floatundidf.zig").__floatundidf, .{ .name = "__floatundidf", .linkage = linkage });
102
103 @export(@import("compiler_rt/floatditf.zig").__floatditf, .{ .name = "__floatditf", .linkage = linkage });
104 @export(@import("compiler_rt/floattitf.zig").__floattitf, .{ .name = "__floattitf", .linkage = linkage });
105 @export(@import("compiler_rt/floattidf.zig").__floattidf, .{ .name = "__floattidf", .linkage = linkage });
106 @export(@import("compiler_rt/floatXisf.zig").__floattisf, .{ .name = "__floattisf", .linkage = linkage });
107 @export(@import("compiler_rt/floatXisf.zig").__floatdisf, .{ .name = "__floatdisf", .linkage = linkage });
108
109 @export(@import("compiler_rt/floatunditf.zig").__floatunditf, .{ .name = "__floatunditf", .linkage = linkage });
110 @export(@import("compiler_rt/floatunsitf.zig").__floatunsitf, .{ .name = "__floatunsitf", .linkage = linkage });
111
112 @export(@import("compiler_rt/floatuntitf.zig").__floatuntitf, .{ .name = "__floatuntitf", .linkage = linkage });
113 @export(@import("compiler_rt/floatuntidf.zig").__floatuntidf, .{ .name = "__floatuntidf", .linkage = linkage });
114 @export(@import("compiler_rt/floatuntisf.zig").__floatuntisf, .{ .name = "__floatuntisf", .linkage = linkage });
115
116 @export(@import("compiler_rt/extendXfYf2.zig").__extenddftf2, .{ .name = "__extenddftf2", .linkage = linkage });
117 @export(@import("compiler_rt/extendXfYf2.zig").__extendsftf2, .{ .name = "__extendsftf2", .linkage = linkage });
118 @export(@import("compiler_rt/extendXfYf2.zig").__extendhfsf2, .{ .name = "__extendhfsf2", .linkage = linkage });
119 @export(@import("compiler_rt/extendXfYf2.zig").__extendhftf2, .{ .name = "__extendhftf2", .linkage = linkage });
120
121 @export(@import("compiler_rt/truncXfYf2.zig").__truncsfhf2, .{ .name = "__truncsfhf2", .linkage = linkage });
122 @export(@import("compiler_rt/truncXfYf2.zig").__truncdfhf2, .{ .name = "__truncdfhf2", .linkage = linkage });
123 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfhf2, .{ .name = "__trunctfhf2", .linkage = linkage });
124 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfdf2, .{ .name = "__trunctfdf2", .linkage = linkage });
125 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfsf2, .{ .name = "__trunctfsf2", .linkage = linkage });
126
127 @export(@import("compiler_rt/truncXfYf2.zig").__truncdfsf2, .{ .name = "__truncdfsf2", .linkage = linkage });
128
129 @export(@import("compiler_rt/extendXfYf2.zig").__extendsfdf2, .{ .name = "__extendsfdf2", .linkage = linkage });
130
131 @export(@import("compiler_rt/fixunssfsi.zig").__fixunssfsi, .{ .name = "__fixunssfsi", .linkage = linkage });
132 @export(@import("compiler_rt/fixunssfdi.zig").__fixunssfdi, .{ .name = "__fixunssfdi", .linkage = linkage });
133 @export(@import("compiler_rt/fixunssfti.zig").__fixunssfti, .{ .name = "__fixunssfti", .linkage = linkage });
134
135 @export(@import("compiler_rt/fixunsdfsi.zig").__fixunsdfsi, .{ .name = "__fixunsdfsi", .linkage = linkage });
136 @export(@import("compiler_rt/fixunsdfdi.zig").__fixunsdfdi, .{ .name = "__fixunsdfdi", .linkage = linkage });
137 @export(@import("compiler_rt/fixunsdfti.zig").__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = linkage });
138
139 @export(@import("compiler_rt/fixunstfsi.zig").__fixunstfsi, .{ .name = "__fixunstfsi", .linkage = linkage });
140 @export(@import("compiler_rt/fixunstfdi.zig").__fixunstfdi, .{ .name = "__fixunstfdi", .linkage = linkage });
141 @export(@import("compiler_rt/fixunstfti.zig").__fixunstfti, .{ .name = "__fixunstfti", .linkage = linkage });
142
143 @export(@import("compiler_rt/fixdfdi.zig").__fixdfdi, .{ .name = "__fixdfdi", .linkage = linkage });
144 @export(@import("compiler_rt/fixdfsi.zig").__fixdfsi, .{ .name = "__fixdfsi", .linkage = linkage });
145 @export(@import("compiler_rt/fixdfti.zig").__fixdfti, .{ .name = "__fixdfti", .linkage = linkage });
146 @export(@import("compiler_rt/fixsfdi.zig").__fixsfdi, .{ .name = "__fixsfdi", .linkage = linkage });
147 @export(@import("compiler_rt/fixsfsi.zig").__fixsfsi, .{ .name = "__fixsfsi", .linkage = linkage });
148 @export(@import("compiler_rt/fixsfti.zig").__fixsfti, .{ .name = "__fixsfti", .linkage = linkage });
149 @export(@import("compiler_rt/fixtfdi.zig").__fixtfdi, .{ .name = "__fixtfdi", .linkage = linkage });
150 @export(@import("compiler_rt/fixtfsi.zig").__fixtfsi, .{ .name = "__fixtfsi", .linkage = linkage });
151 @export(@import("compiler_rt/fixtfti.zig").__fixtfti, .{ .name = "__fixtfti", .linkage = linkage });
152
153 @export(@import("compiler_rt/int.zig").__udivmoddi4, .{ .name = "__udivmoddi4", .linkage = linkage });
154 @export(@import("compiler_rt/popcountdi2.zig").__popcountdi2, .{ .name = "__popcountdi2", .linkage = linkage });
155
156 @export(@import("compiler_rt/int.zig").__mulsi3, .{ .name = "__mulsi3", .linkage = linkage });
157 @export(@import("compiler_rt/muldi3.zig").__muldi3, .{ .name = "__muldi3", .linkage = linkage });
158 @export(@import("compiler_rt/int.zig").__divmoddi4, .{ .name = "__divmoddi4", .linkage = linkage });
159 @export(@import("compiler_rt/int.zig").__divsi3, .{ .name = "__divsi3", .linkage = linkage });
160 @export(@import("compiler_rt/int.zig").__divdi3, .{ .name = "__divdi3", .linkage = linkage });
161 @export(@import("compiler_rt/int.zig").__udivsi3, .{ .name = "__udivsi3", .linkage = linkage });
162 @export(@import("compiler_rt/int.zig").__udivdi3, .{ .name = "__udivdi3", .linkage = linkage });
163 @export(@import("compiler_rt/int.zig").__modsi3, .{ .name = "__modsi3", .linkage = linkage });
164 @export(@import("compiler_rt/int.zig").__moddi3, .{ .name = "__moddi3", .linkage = linkage });
165 @export(@import("compiler_rt/int.zig").__umodsi3, .{ .name = "__umodsi3", .linkage = linkage });
166 @export(@import("compiler_rt/int.zig").__umoddi3, .{ .name = "__umoddi3", .linkage = linkage });
167 @export(@import("compiler_rt/int.zig").__divmodsi4, .{ .name = "__divmodsi4", .linkage = linkage });
168 @export(@import("compiler_rt/int.zig").__udivmodsi4, .{ .name = "__udivmodsi4", .linkage = linkage });
169
170 @export(@import("compiler_rt/negXf2.zig").__negsf2, .{ .name = "__negsf2", .linkage = linkage });
171 @export(@import("compiler_rt/negXf2.zig").__negdf2, .{ .name = "__negdf2", .linkage = linkage });
172
173 @export(@import("compiler_rt/clzsi2.zig").__clzsi2, .{ .name = "__clzsi2", .linkage = linkage });
86 const __unordsf2 = @import("compiler_rt/compareXf2.zig").__unordsf2;
87 @export(__unordsf2, .{ .name = "__unordsf2", .linkage = linkage });
88 const __unorddf2 = @import("compiler_rt/compareXf2.zig").__unorddf2;
89 @export(__unorddf2, .{ .name = "__unorddf2", .linkage = linkage });
90 const __unordtf2 = @import("compiler_rt/compareXf2.zig").__unordtf2;
91 @export(__unordtf2, .{ .name = "__unordtf2", .linkage = linkage });
92
93 const __addsf3 = @import("compiler_rt/addXf3.zig").__addsf3;
94 @export(__addsf3, .{ .name = "__addsf3", .linkage = linkage });
95 const __adddf3 = @import("compiler_rt/addXf3.zig").__adddf3;
96 @export(__adddf3, .{ .name = "__adddf3", .linkage = linkage });
97 const __addtf3 = @import("compiler_rt/addXf3.zig").__addtf3;
98 @export(__addtf3, .{ .name = "__addtf3", .linkage = linkage });
99 const __subsf3 = @import("compiler_rt/addXf3.zig").__subsf3;
100 @export(__subsf3, .{ .name = "__subsf3", .linkage = linkage });
101 const __subdf3 = @import("compiler_rt/addXf3.zig").__subdf3;
102 @export(__subdf3, .{ .name = "__subdf3", .linkage = linkage });
103 const __subtf3 = @import("compiler_rt/addXf3.zig").__subtf3;
104 @export(__subtf3, .{ .name = "__subtf3", .linkage = linkage });
105
106 const __mulsf3 = @import("compiler_rt/mulXf3.zig").__mulsf3;
107 @export(__mulsf3, .{ .name = "__mulsf3", .linkage = linkage });
108 const __muldf3 = @import("compiler_rt/mulXf3.zig").__muldf3;
109 @export(__muldf3, .{ .name = "__muldf3", .linkage = linkage });
110 const __multf3 = @import("compiler_rt/mulXf3.zig").__multf3;
111 @export(__multf3, .{ .name = "__multf3", .linkage = linkage });
112
113 const __divsf3 = @import("compiler_rt/divsf3.zig").__divsf3;
114 @export(__divsf3, .{ .name = "__divsf3", .linkage = linkage });
115 const __divdf3 = @import("compiler_rt/divdf3.zig").__divdf3;
116 @export(__divdf3, .{ .name = "__divdf3", .linkage = linkage });
117 const __divtf3 = @import("compiler_rt/divtf3.zig").__divtf3;
118 @export(__divtf3, .{ .name = "__divtf3", .linkage = linkage });
119
120 const __ashldi3 = @import("compiler_rt/shift.zig").__ashldi3;
121 @export(__ashldi3, .{ .name = "__ashldi3", .linkage = linkage });
122 const __ashlti3 = @import("compiler_rt/shift.zig").__ashlti3;
123 @export(__ashlti3, .{ .name = "__ashlti3", .linkage = linkage });
124 const __ashrdi3 = @import("compiler_rt/shift.zig").__ashrdi3;
125 @export(__ashrdi3, .{ .name = "__ashrdi3", .linkage = linkage });
126 const __ashrti3 = @import("compiler_rt/shift.zig").__ashrti3;
127 @export(__ashrti3, .{ .name = "__ashrti3", .linkage = linkage });
128 const __lshrdi3 = @import("compiler_rt/shift.zig").__lshrdi3;
129 @export(__lshrdi3, .{ .name = "__lshrdi3", .linkage = linkage });
130 const __lshrti3 = @import("compiler_rt/shift.zig").__lshrti3;
131 @export(__lshrti3, .{ .name = "__lshrti3", .linkage = linkage });
132
133 const __floatsidf = @import("compiler_rt/floatsiXf.zig").__floatsidf;
134 @export(__floatsidf, .{ .name = "__floatsidf", .linkage = linkage });
135 const __floatsisf = @import("compiler_rt/floatsiXf.zig").__floatsisf;
136 @export(__floatsisf, .{ .name = "__floatsisf", .linkage = linkage });
137 const __floatdidf = @import("compiler_rt/floatdidf.zig").__floatdidf;
138 @export(__floatdidf, .{ .name = "__floatdidf", .linkage = linkage });
139 const __floatsitf = @import("compiler_rt/floatsiXf.zig").__floatsitf;
140 @export(__floatsitf, .{ .name = "__floatsitf", .linkage = linkage });
141
142 const __floatunsisf = @import("compiler_rt/floatunsisf.zig").__floatunsisf;
143 @export(__floatunsisf, .{ .name = "__floatunsisf", .linkage = linkage });
144 const __floatundisf = @import("compiler_rt/floatundisf.zig").__floatundisf;
145 @export(__floatundisf, .{ .name = "__floatundisf", .linkage = linkage });
146 const __floatunsidf = @import("compiler_rt/floatunsidf.zig").__floatunsidf;
147 @export(__floatunsidf, .{ .name = "__floatunsidf", .linkage = linkage });
148 const __floatundidf = @import("compiler_rt/floatundidf.zig").__floatundidf;
149 @export(__floatundidf, .{ .name = "__floatundidf", .linkage = linkage });
150
151 const __floatditf = @import("compiler_rt/floatditf.zig").__floatditf;
152 @export(__floatditf, .{ .name = "__floatditf", .linkage = linkage });
153 const __floattitf = @import("compiler_rt/floattitf.zig").__floattitf;
154 @export(__floattitf, .{ .name = "__floattitf", .linkage = linkage });
155 const __floattidf = @import("compiler_rt/floattidf.zig").__floattidf;
156 @export(__floattidf, .{ .name = "__floattidf", .linkage = linkage });
157 const __floattisf = @import("compiler_rt/floatXisf.zig").__floattisf;
158 @export(__floattisf, .{ .name = "__floattisf", .linkage = linkage });
159 const __floatdisf = @import("compiler_rt/floatXisf.zig").__floatdisf;
160 @export(__floatdisf, .{ .name = "__floatdisf", .linkage = linkage });
161
162 const __floatunditf = @import("compiler_rt/floatunditf.zig").__floatunditf;
163 @export(__floatunditf, .{ .name = "__floatunditf", .linkage = linkage });
164 const __floatunsitf = @import("compiler_rt/floatunsitf.zig").__floatunsitf;
165 @export(__floatunsitf, .{ .name = "__floatunsitf", .linkage = linkage });
166
167 const __floatuntitf = @import("compiler_rt/floatuntitf.zig").__floatuntitf;
168 @export(__floatuntitf, .{ .name = "__floatuntitf", .linkage = linkage });
169 const __floatuntidf = @import("compiler_rt/floatuntidf.zig").__floatuntidf;
170 @export(__floatuntidf, .{ .name = "__floatuntidf", .linkage = linkage });
171 const __floatuntisf = @import("compiler_rt/floatuntisf.zig").__floatuntisf;
172 @export(__floatuntisf, .{ .name = "__floatuntisf", .linkage = linkage });
173
174 const __extenddftf2 = @import("compiler_rt/extendXfYf2.zig").__extenddftf2;
175 @export(__extenddftf2, .{ .name = "__extenddftf2", .linkage = linkage });
176 const __extendsftf2 = @import("compiler_rt/extendXfYf2.zig").__extendsftf2;
177 @export(__extendsftf2, .{ .name = "__extendsftf2", .linkage = linkage });
178 const __extendhfsf2 = @import("compiler_rt/extendXfYf2.zig").__extendhfsf2;
179 @export(__extendhfsf2, .{ .name = "__extendhfsf2", .linkage = linkage });
180 const __extendhftf2 = @import("compiler_rt/extendXfYf2.zig").__extendhftf2;
181 @export(__extendhftf2, .{ .name = "__extendhftf2", .linkage = linkage });
182
183 const __truncsfhf2 = @import("compiler_rt/truncXfYf2.zig").__truncsfhf2;
184 @export(__truncsfhf2, .{ .name = "__truncsfhf2", .linkage = linkage });
185 const __truncdfhf2 = @import("compiler_rt/truncXfYf2.zig").__truncdfhf2;
186 @export(__truncdfhf2, .{ .name = "__truncdfhf2", .linkage = linkage });
187 const __trunctfhf2 = @import("compiler_rt/truncXfYf2.zig").__trunctfhf2;
188 @export(__trunctfhf2, .{ .name = "__trunctfhf2", .linkage = linkage });
189 const __trunctfdf2 = @import("compiler_rt/truncXfYf2.zig").__trunctfdf2;
190 @export(__trunctfdf2, .{ .name = "__trunctfdf2", .linkage = linkage });
191 const __trunctfsf2 = @import("compiler_rt/truncXfYf2.zig").__trunctfsf2;
192 @export(__trunctfsf2, .{ .name = "__trunctfsf2", .linkage = linkage });
193
194 const __truncdfsf2 = @import("compiler_rt/truncXfYf2.zig").__truncdfsf2;
195 @export(__truncdfsf2, .{ .name = "__truncdfsf2", .linkage = linkage });
196
197 const __extendsfdf2 = @import("compiler_rt/extendXfYf2.zig").__extendsfdf2;
198 @export(__extendsfdf2, .{ .name = "__extendsfdf2", .linkage = linkage });
199
200 const __fixunssfsi = @import("compiler_rt/fixunssfsi.zig").__fixunssfsi;
201 @export(__fixunssfsi, .{ .name = "__fixunssfsi", .linkage = linkage });
202 const __fixunssfdi = @import("compiler_rt/fixunssfdi.zig").__fixunssfdi;
203 @export(__fixunssfdi, .{ .name = "__fixunssfdi", .linkage = linkage });
204 const __fixunssfti = @import("compiler_rt/fixunssfti.zig").__fixunssfti;
205 @export(__fixunssfti, .{ .name = "__fixunssfti", .linkage = linkage });
206
207 const __fixunsdfsi = @import("compiler_rt/fixunsdfsi.zig").__fixunsdfsi;
208 @export(__fixunsdfsi, .{ .name = "__fixunsdfsi", .linkage = linkage });
209 const __fixunsdfdi = @import("compiler_rt/fixunsdfdi.zig").__fixunsdfdi;
210 @export(__fixunsdfdi, .{ .name = "__fixunsdfdi", .linkage = linkage });
211 const __fixunsdfti = @import("compiler_rt/fixunsdfti.zig").__fixunsdfti;
212 @export(__fixunsdfti, .{ .name = "__fixunsdfti", .linkage = linkage });
213
214 const __fixunstfsi = @import("compiler_rt/fixunstfsi.zig").__fixunstfsi;
215 @export(__fixunstfsi, .{ .name = "__fixunstfsi", .linkage = linkage });
216 const __fixunstfdi = @import("compiler_rt/fixunstfdi.zig").__fixunstfdi;
217 @export(__fixunstfdi, .{ .name = "__fixunstfdi", .linkage = linkage });
218 const __fixunstfti = @import("compiler_rt/fixunstfti.zig").__fixunstfti;
219 @export(__fixunstfti, .{ .name = "__fixunstfti", .linkage = linkage });
220
221 const __fixdfdi = @import("compiler_rt/fixdfdi.zig").__fixdfdi;
222 @export(__fixdfdi, .{ .name = "__fixdfdi", .linkage = linkage });
223 const __fixdfsi = @import("compiler_rt/fixdfsi.zig").__fixdfsi;
224 @export(__fixdfsi, .{ .name = "__fixdfsi", .linkage = linkage });
225 const __fixdfti = @import("compiler_rt/fixdfti.zig").__fixdfti;
226 @export(__fixdfti, .{ .name = "__fixdfti", .linkage = linkage });
227 const __fixsfdi = @import("compiler_rt/fixsfdi.zig").__fixsfdi;
228 @export(__fixsfdi, .{ .name = "__fixsfdi", .linkage = linkage });
229 const __fixsfsi = @import("compiler_rt/fixsfsi.zig").__fixsfsi;
230 @export(__fixsfsi, .{ .name = "__fixsfsi", .linkage = linkage });
231 const __fixsfti = @import("compiler_rt/fixsfti.zig").__fixsfti;
232 @export(__fixsfti, .{ .name = "__fixsfti", .linkage = linkage });
233 const __fixtfdi = @import("compiler_rt/fixtfdi.zig").__fixtfdi;
234 @export(__fixtfdi, .{ .name = "__fixtfdi", .linkage = linkage });
235 const __fixtfsi = @import("compiler_rt/fixtfsi.zig").__fixtfsi;
236 @export(__fixtfsi, .{ .name = "__fixtfsi", .linkage = linkage });
237 const __fixtfti = @import("compiler_rt/fixtfti.zig").__fixtfti;
238 @export(__fixtfti, .{ .name = "__fixtfti", .linkage = linkage });
239
240 const __udivmoddi4 = @import("compiler_rt/int.zig").__udivmoddi4;
241 @export(__udivmoddi4, .{ .name = "__udivmoddi4", .linkage = linkage });
242 const __popcountdi2 = @import("compiler_rt/popcountdi2.zig").__popcountdi2;
243 @export(__popcountdi2, .{ .name = "__popcountdi2", .linkage = linkage });
244
245 const __mulsi3 = @import("compiler_rt/int.zig").__mulsi3;
246 @export(__mulsi3, .{ .name = "__mulsi3", .linkage = linkage });
247 const __muldi3 = @import("compiler_rt/muldi3.zig").__muldi3;
248 @export(__muldi3, .{ .name = "__muldi3", .linkage = linkage });
249 const __divmoddi4 = @import("compiler_rt/int.zig").__divmoddi4;
250 @export(__divmoddi4, .{ .name = "__divmoddi4", .linkage = linkage });
251 const __divsi3 = @import("compiler_rt/int.zig").__divsi3;
252 @export(__divsi3, .{ .name = "__divsi3", .linkage = linkage });
253 const __divdi3 = @import("compiler_rt/int.zig").__divdi3;
254 @export(__divdi3, .{ .name = "__divdi3", .linkage = linkage });
255 const __udivsi3 = @import("compiler_rt/int.zig").__udivsi3;
256 @export(__udivsi3, .{ .name = "__udivsi3", .linkage = linkage });
257 const __udivdi3 = @import("compiler_rt/int.zig").__udivdi3;
258 @export(__udivdi3, .{ .name = "__udivdi3", .linkage = linkage });
259 const __modsi3 = @import("compiler_rt/int.zig").__modsi3;
260 @export(__modsi3, .{ .name = "__modsi3", .linkage = linkage });
261 const __moddi3 = @import("compiler_rt/int.zig").__moddi3;
262 @export(__moddi3, .{ .name = "__moddi3", .linkage = linkage });
263 const __umodsi3 = @import("compiler_rt/int.zig").__umodsi3;
264 @export(__umodsi3, .{ .name = "__umodsi3", .linkage = linkage });
265 const __umoddi3 = @import("compiler_rt/int.zig").__umoddi3;
266 @export(__umoddi3, .{ .name = "__umoddi3", .linkage = linkage });
267 const __divmodsi4 = @import("compiler_rt/int.zig").__divmodsi4;
268 @export(__divmodsi4, .{ .name = "__divmodsi4", .linkage = linkage });
269 const __udivmodsi4 = @import("compiler_rt/int.zig").__udivmodsi4;
270 @export(__udivmodsi4, .{ .name = "__udivmodsi4", .linkage = linkage });
271
272 const __negsf2 = @import("compiler_rt/negXf2.zig").__negsf2;
273 @export(__negsf2, .{ .name = "__negsf2", .linkage = linkage });
274 const __negdf2 = @import("compiler_rt/negXf2.zig").__negdf2;
275 @export(__negdf2, .{ .name = "__negdf2", .linkage = linkage });
276
277 const __clzsi2 = @import("compiler_rt/clzsi2.zig").__clzsi2;
278 @export(__clzsi2, .{ .name = "__clzsi2", .linkage = linkage });
174279
175280 if (builtin.link_libc and os_tag == .openbsd) {
176 @export(@import("compiler_rt/emutls.zig").__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = linkage });
281 const __emutls_get_address = @import("compiler_rt/emutls.zig").__emutls_get_address;
282 @export(__emutls_get_address, .{ .name = "__emutls_get_address", .linkage = linkage });
177283 }
178284
179285 if ((arch.isARM() or arch.isThumb()) and !is_test) {
180 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr0, .{ .name = "__aeabi_unwind_cpp_pr0", .linkage = linkage });
181 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = linkage });
182 @export(@import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr2, .{ .name = "__aeabi_unwind_cpp_pr2", .linkage = linkage });
183
184 @export(@import("compiler_rt/muldi3.zig").__muldi3, .{ .name = "__aeabi_lmul", .linkage = linkage });
185
186 @export(@import("compiler_rt/arm.zig").__aeabi_ldivmod, .{ .name = "__aeabi_ldivmod", .linkage = linkage });
187 @export(@import("compiler_rt/arm.zig").__aeabi_uldivmod, .{ .name = "__aeabi_uldivmod", .linkage = linkage });
188
189 @export(@import("compiler_rt/int.zig").__divsi3, .{ .name = "__aeabi_idiv", .linkage = linkage });
190 @export(@import("compiler_rt/arm.zig").__aeabi_idivmod, .{ .name = "__aeabi_idivmod", .linkage = linkage });
191 @export(@import("compiler_rt/int.zig").__udivsi3, .{ .name = "__aeabi_uidiv", .linkage = linkage });
192 @export(@import("compiler_rt/arm.zig").__aeabi_uidivmod, .{ .name = "__aeabi_uidivmod", .linkage = linkage });
193
194 @export(@import("compiler_rt/arm.zig").__aeabi_memcpy, .{ .name = "__aeabi_memcpy", .linkage = linkage });
195 @export(@import("compiler_rt/arm.zig").__aeabi_memcpy, .{ .name = "__aeabi_memcpy4", .linkage = linkage });
196 @export(@import("compiler_rt/arm.zig").__aeabi_memcpy, .{ .name = "__aeabi_memcpy8", .linkage = linkage });
197
198 @export(@import("compiler_rt/arm.zig").__aeabi_memmove, .{ .name = "__aeabi_memmove", .linkage = linkage });
199 @export(@import("compiler_rt/arm.zig").__aeabi_memmove, .{ .name = "__aeabi_memmove4", .linkage = linkage });
200 @export(@import("compiler_rt/arm.zig").__aeabi_memmove, .{ .name = "__aeabi_memmove8", .linkage = linkage });
201
202 @export(@import("compiler_rt/arm.zig").__aeabi_memset, .{ .name = "__aeabi_memset", .linkage = linkage });
203 @export(@import("compiler_rt/arm.zig").__aeabi_memset, .{ .name = "__aeabi_memset4", .linkage = linkage });
204 @export(@import("compiler_rt/arm.zig").__aeabi_memset, .{ .name = "__aeabi_memset8", .linkage = linkage });
205
206 @export(@import("compiler_rt/arm.zig").__aeabi_memclr, .{ .name = "__aeabi_memclr", .linkage = linkage });
207 @export(@import("compiler_rt/arm.zig").__aeabi_memclr, .{ .name = "__aeabi_memclr4", .linkage = linkage });
208 @export(@import("compiler_rt/arm.zig").__aeabi_memclr, .{ .name = "__aeabi_memclr8", .linkage = linkage });
286 const __aeabi_unwind_cpp_pr0 = @import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr0;
287 @export(__aeabi_unwind_cpp_pr0, .{ .name = "__aeabi_unwind_cpp_pr0", .linkage = linkage });
288 const __aeabi_unwind_cpp_pr1 = @import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr1;
289 @export(__aeabi_unwind_cpp_pr1, .{ .name = "__aeabi_unwind_cpp_pr1", .linkage = linkage });
290 const __aeabi_unwind_cpp_pr2 = @import("compiler_rt/arm.zig").__aeabi_unwind_cpp_pr2;
291 @export(__aeabi_unwind_cpp_pr2, .{ .name = "__aeabi_unwind_cpp_pr2", .linkage = linkage });
292
293 @export(__muldi3, .{ .name = "__aeabi_lmul", .linkage = linkage });
294
295 const __aeabi_ldivmod = @import("compiler_rt/arm.zig").__aeabi_ldivmod;
296 @export(__aeabi_ldivmod, .{ .name = "__aeabi_ldivmod", .linkage = linkage });
297 const __aeabi_uldivmod = @import("compiler_rt/arm.zig").__aeabi_uldivmod;
298 @export(__aeabi_uldivmod, .{ .name = "__aeabi_uldivmod", .linkage = linkage });
299
300 @export(__divsi3, .{ .name = "__aeabi_idiv", .linkage = linkage });
301 const __aeabi_idivmod = @import("compiler_rt/arm.zig").__aeabi_idivmod;
302 @export(__aeabi_idivmod, .{ .name = "__aeabi_idivmod", .linkage = linkage });
303 @export(__udivsi3, .{ .name = "__aeabi_uidiv", .linkage = linkage });
304 const __aeabi_uidivmod = @import("compiler_rt/arm.zig").__aeabi_uidivmod;
305 @export(__aeabi_uidivmod, .{ .name = "__aeabi_uidivmod", .linkage = linkage });
306
307 const __aeabi_memcpy = @import("compiler_rt/arm.zig").__aeabi_memcpy;
308 @export(__aeabi_memcpy, .{ .name = "__aeabi_memcpy", .linkage = linkage });
309 @export(__aeabi_memcpy, .{ .name = "__aeabi_memcpy4", .linkage = linkage });
310 @export(__aeabi_memcpy, .{ .name = "__aeabi_memcpy8", .linkage = linkage });
311
312 const __aeabi_memmove = @import("compiler_rt/arm.zig").__aeabi_memmove;
313 @export(__aeabi_memmove, .{ .name = "__aeabi_memmove", .linkage = linkage });
314 @export(__aeabi_memmove, .{ .name = "__aeabi_memmove4", .linkage = linkage });
315 @export(__aeabi_memmove, .{ .name = "__aeabi_memmove8", .linkage = linkage });
316
317 const __aeabi_memset = @import("compiler_rt/arm.zig").__aeabi_memset;
318 @export(__aeabi_memset, .{ .name = "__aeabi_memset", .linkage = linkage });
319 @export(__aeabi_memset, .{ .name = "__aeabi_memset4", .linkage = linkage });
320 @export(__aeabi_memset, .{ .name = "__aeabi_memset8", .linkage = linkage });
321
322 const __aeabi_memclr = @import("compiler_rt/arm.zig").__aeabi_memclr;
323 @export(__aeabi_memclr, .{ .name = "__aeabi_memclr", .linkage = linkage });
324 @export(__aeabi_memclr, .{ .name = "__aeabi_memclr4", .linkage = linkage });
325 @export(__aeabi_memclr, .{ .name = "__aeabi_memclr8", .linkage = linkage });
209326
210327 if (os_tag == .linux) {
211 @export(@import("compiler_rt/arm.zig").__aeabi_read_tp, .{ .name = "__aeabi_read_tp", .linkage = linkage });
328 const __aeabi_read_tp = @import("compiler_rt/arm.zig").__aeabi_read_tp;
329 @export(__aeabi_read_tp, .{ .name = "__aeabi_read_tp", .linkage = linkage });
212330 }
213331
214 @export(@import("compiler_rt/extendXfYf2.zig").__aeabi_f2d, .{ .name = "__aeabi_f2d", .linkage = linkage });
215 @export(@import("compiler_rt/floatsiXf.zig").__aeabi_i2d, .{ .name = "__aeabi_i2d", .linkage = linkage });
216 @export(@import("compiler_rt/floatdidf.zig").__aeabi_l2d, .{ .name = "__aeabi_l2d", .linkage = linkage });
217 @export(@import("compiler_rt/floatXisf.zig").__aeabi_l2f, .{ .name = "__aeabi_l2f", .linkage = linkage });
218 @export(@import("compiler_rt/floatunsidf.zig").__aeabi_ui2d, .{ .name = "__aeabi_ui2d", .linkage = linkage });
219 @export(@import("compiler_rt/floatundidf.zig").__aeabi_ul2d, .{ .name = "__aeabi_ul2d", .linkage = linkage });
220 @export(@import("compiler_rt/floatunsisf.zig").__aeabi_ui2f, .{ .name = "__aeabi_ui2f", .linkage = linkage });
221 @export(@import("compiler_rt/floatundisf.zig").__aeabi_ul2f, .{ .name = "__aeabi_ul2f", .linkage = linkage });
222
223 @export(@import("compiler_rt/negXf2.zig").__aeabi_fneg, .{ .name = "__aeabi_fneg", .linkage = linkage });
224 @export(@import("compiler_rt/negXf2.zig").__aeabi_dneg, .{ .name = "__aeabi_dneg", .linkage = linkage });
225
226 @export(@import("compiler_rt/mulXf3.zig").__aeabi_fmul, .{ .name = "__aeabi_fmul", .linkage = linkage });
227 @export(@import("compiler_rt/mulXf3.zig").__aeabi_dmul, .{ .name = "__aeabi_dmul", .linkage = linkage });
228
229 @export(@import("compiler_rt/truncXfYf2.zig").__aeabi_d2h, .{ .name = "__aeabi_d2h", .linkage = linkage });
230
231 @export(@import("compiler_rt/fixunssfdi.zig").__aeabi_f2ulz, .{ .name = "__aeabi_f2ulz", .linkage = linkage });
232 @export(@import("compiler_rt/fixunsdfdi.zig").__aeabi_d2ulz, .{ .name = "__aeabi_d2ulz", .linkage = linkage });
233
234 @export(@import("compiler_rt/fixsfdi.zig").__aeabi_f2lz, .{ .name = "__aeabi_f2lz", .linkage = linkage });
235 @export(@import("compiler_rt/fixdfdi.zig").__aeabi_d2lz, .{ .name = "__aeabi_d2lz", .linkage = linkage });
236
237 @export(@import("compiler_rt/fixunsdfsi.zig").__aeabi_d2uiz, .{ .name = "__aeabi_d2uiz", .linkage = linkage });
238
239 @export(@import("compiler_rt/extendXfYf2.zig").__aeabi_h2f, .{ .name = "__aeabi_h2f", .linkage = linkage });
240 @export(@import("compiler_rt/truncXfYf2.zig").__aeabi_f2h, .{ .name = "__aeabi_f2h", .linkage = linkage });
241
242 @export(@import("compiler_rt/floatsiXf.zig").__aeabi_i2f, .{ .name = "__aeabi_i2f", .linkage = linkage });
243 @export(@import("compiler_rt/truncXfYf2.zig").__aeabi_d2f, .{ .name = "__aeabi_d2f", .linkage = linkage });
244
245 @export(@import("compiler_rt/addXf3.zig").__aeabi_fadd, .{ .name = "__aeabi_fadd", .linkage = linkage });
246 @export(@import("compiler_rt/addXf3.zig").__aeabi_dadd, .{ .name = "__aeabi_dadd", .linkage = linkage });
247 @export(@import("compiler_rt/addXf3.zig").__aeabi_fsub, .{ .name = "__aeabi_fsub", .linkage = linkage });
248 @export(@import("compiler_rt/addXf3.zig").__aeabi_dsub, .{ .name = "__aeabi_dsub", .linkage = linkage });
249
250 @export(@import("compiler_rt/fixunssfsi.zig").__aeabi_f2uiz, .{ .name = "__aeabi_f2uiz", .linkage = linkage });
251
252 @export(@import("compiler_rt/fixsfsi.zig").__aeabi_f2iz, .{ .name = "__aeabi_f2iz", .linkage = linkage });
253 @export(@import("compiler_rt/fixdfsi.zig").__aeabi_d2iz, .{ .name = "__aeabi_d2iz", .linkage = linkage });
254
255 @export(@import("compiler_rt/divsf3.zig").__aeabi_fdiv, .{ .name = "__aeabi_fdiv", .linkage = linkage });
256 @export(@import("compiler_rt/divdf3.zig").__aeabi_ddiv, .{ .name = "__aeabi_ddiv", .linkage = linkage });
257
258 @export(@import("compiler_rt/shift.zig").__aeabi_llsl, .{ .name = "__aeabi_llsl", .linkage = linkage });
259 @export(@import("compiler_rt/shift.zig").__aeabi_lasr, .{ .name = "__aeabi_lasr", .linkage = linkage });
260 @export(@import("compiler_rt/shift.zig").__aeabi_llsr, .{ .name = "__aeabi_llsr", .linkage = linkage });
261
262 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpeq, .{ .name = "__aeabi_fcmpeq", .linkage = linkage });
263 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmplt, .{ .name = "__aeabi_fcmplt", .linkage = linkage });
264 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmple, .{ .name = "__aeabi_fcmple", .linkage = linkage });
265 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpge, .{ .name = "__aeabi_fcmpge", .linkage = linkage });
266 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpgt, .{ .name = "__aeabi_fcmpgt", .linkage = linkage });
267 @export(@import("compiler_rt/compareXf2.zig").__aeabi_fcmpun, .{ .name = "__aeabi_fcmpun", .linkage = linkage });
268
269 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpeq, .{ .name = "__aeabi_dcmpeq", .linkage = linkage });
270 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmplt, .{ .name = "__aeabi_dcmplt", .linkage = linkage });
271 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmple, .{ .name = "__aeabi_dcmple", .linkage = linkage });
272 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpge, .{ .name = "__aeabi_dcmpge", .linkage = linkage });
273 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpgt, .{ .name = "__aeabi_dcmpgt", .linkage = linkage });
274 @export(@import("compiler_rt/compareXf2.zig").__aeabi_dcmpun, .{ .name = "__aeabi_dcmpun", .linkage = linkage });
332 const __aeabi_f2d = @import("compiler_rt/extendXfYf2.zig").__aeabi_f2d;
333 @export(__aeabi_f2d, .{ .name = "__aeabi_f2d", .linkage = linkage });
334 const __aeabi_i2d = @import("compiler_rt/floatsiXf.zig").__aeabi_i2d;
335 @export(__aeabi_i2d, .{ .name = "__aeabi_i2d", .linkage = linkage });
336 const __aeabi_l2d = @import("compiler_rt/floatdidf.zig").__aeabi_l2d;
337 @export(__aeabi_l2d, .{ .name = "__aeabi_l2d", .linkage = linkage });
338 const __aeabi_l2f = @import("compiler_rt/floatXisf.zig").__aeabi_l2f;
339 @export(__aeabi_l2f, .{ .name = "__aeabi_l2f", .linkage = linkage });
340 const __aeabi_ui2d = @import("compiler_rt/floatunsidf.zig").__aeabi_ui2d;
341 @export(__aeabi_ui2d, .{ .name = "__aeabi_ui2d", .linkage = linkage });
342 const __aeabi_ul2d = @import("compiler_rt/floatundidf.zig").__aeabi_ul2d;
343 @export(__aeabi_ul2d, .{ .name = "__aeabi_ul2d", .linkage = linkage });
344 const __aeabi_ui2f = @import("compiler_rt/floatunsisf.zig").__aeabi_ui2f;
345 @export(__aeabi_ui2f, .{ .name = "__aeabi_ui2f", .linkage = linkage });
346 const __aeabi_ul2f = @import("compiler_rt/floatundisf.zig").__aeabi_ul2f;
347 @export(__aeabi_ul2f, .{ .name = "__aeabi_ul2f", .linkage = linkage });
348
349 const __aeabi_fneg = @import("compiler_rt/negXf2.zig").__aeabi_fneg;
350 @export(__aeabi_fneg, .{ .name = "__aeabi_fneg", .linkage = linkage });
351 const __aeabi_dneg = @import("compiler_rt/negXf2.zig").__aeabi_dneg;
352 @export(__aeabi_dneg, .{ .name = "__aeabi_dneg", .linkage = linkage });
353
354 const __aeabi_fmul = @import("compiler_rt/mulXf3.zig").__aeabi_fmul;
355 @export(__aeabi_fmul, .{ .name = "__aeabi_fmul", .linkage = linkage });
356 const __aeabi_dmul = @import("compiler_rt/mulXf3.zig").__aeabi_dmul;
357 @export(__aeabi_dmul, .{ .name = "__aeabi_dmul", .linkage = linkage });
358
359 const __aeabi_d2h = @import("compiler_rt/truncXfYf2.zig").__aeabi_d2h;
360 @export(__aeabi_d2h, .{ .name = "__aeabi_d2h", .linkage = linkage });
361
362 const __aeabi_f2ulz = @import("compiler_rt/fixunssfdi.zig").__aeabi_f2ulz;
363 @export(__aeabi_f2ulz, .{ .name = "__aeabi_f2ulz", .linkage = linkage });
364 const __aeabi_d2ulz = @import("compiler_rt/fixunsdfdi.zig").__aeabi_d2ulz;
365 @export(__aeabi_d2ulz, .{ .name = "__aeabi_d2ulz", .linkage = linkage });
366
367 const __aeabi_f2lz = @import("compiler_rt/fixsfdi.zig").__aeabi_f2lz;
368 @export(__aeabi_f2lz, .{ .name = "__aeabi_f2lz", .linkage = linkage });
369 const __aeabi_d2lz = @import("compiler_rt/fixdfdi.zig").__aeabi_d2lz;
370 @export(__aeabi_d2lz, .{ .name = "__aeabi_d2lz", .linkage = linkage });
371
372 const __aeabi_d2uiz = @import("compiler_rt/fixunsdfsi.zig").__aeabi_d2uiz;
373 @export(__aeabi_d2uiz, .{ .name = "__aeabi_d2uiz", .linkage = linkage });
374
375 const __aeabi_h2f = @import("compiler_rt/extendXfYf2.zig").__aeabi_h2f;
376 @export(__aeabi_h2f, .{ .name = "__aeabi_h2f", .linkage = linkage });
377 const __aeabi_f2h = @import("compiler_rt/truncXfYf2.zig").__aeabi_f2h;
378 @export(__aeabi_f2h, .{ .name = "__aeabi_f2h", .linkage = linkage });
379
380 const __aeabi_i2f = @import("compiler_rt/floatsiXf.zig").__aeabi_i2f;
381 @export(__aeabi_i2f, .{ .name = "__aeabi_i2f", .linkage = linkage });
382 const __aeabi_d2f = @import("compiler_rt/truncXfYf2.zig").__aeabi_d2f;
383 @export(__aeabi_d2f, .{ .name = "__aeabi_d2f", .linkage = linkage });
384
385 const __aeabi_fadd = @import("compiler_rt/addXf3.zig").__aeabi_fadd;
386 @export(__aeabi_fadd, .{ .name = "__aeabi_fadd", .linkage = linkage });
387 const __aeabi_dadd = @import("compiler_rt/addXf3.zig").__aeabi_dadd;
388 @export(__aeabi_dadd, .{ .name = "__aeabi_dadd", .linkage = linkage });
389 const __aeabi_fsub = @import("compiler_rt/addXf3.zig").__aeabi_fsub;
390 @export(__aeabi_fsub, .{ .name = "__aeabi_fsub", .linkage = linkage });
391 const __aeabi_dsub = @import("compiler_rt/addXf3.zig").__aeabi_dsub;
392 @export(__aeabi_dsub, .{ .name = "__aeabi_dsub", .linkage = linkage });
393
394 const __aeabi_f2uiz = @import("compiler_rt/fixunssfsi.zig").__aeabi_f2uiz;
395 @export(__aeabi_f2uiz, .{ .name = "__aeabi_f2uiz", .linkage = linkage });
396
397 const __aeabi_f2iz = @import("compiler_rt/fixsfsi.zig").__aeabi_f2iz;
398 @export(__aeabi_f2iz, .{ .name = "__aeabi_f2iz", .linkage = linkage });
399 const __aeabi_d2iz = @import("compiler_rt/fixdfsi.zig").__aeabi_d2iz;
400 @export(__aeabi_d2iz, .{ .name = "__aeabi_d2iz", .linkage = linkage });
401
402 const __aeabi_fdiv = @import("compiler_rt/divsf3.zig").__aeabi_fdiv;
403 @export(__aeabi_fdiv, .{ .name = "__aeabi_fdiv", .linkage = linkage });
404 const __aeabi_ddiv = @import("compiler_rt/divdf3.zig").__aeabi_ddiv;
405 @export(__aeabi_ddiv, .{ .name = "__aeabi_ddiv", .linkage = linkage });
406
407 const __aeabi_llsl = @import("compiler_rt/shift.zig").__aeabi_llsl;
408 @export(__aeabi_llsl, .{ .name = "__aeabi_llsl", .linkage = linkage });
409 const __aeabi_lasr = @import("compiler_rt/shift.zig").__aeabi_lasr;
410 @export(__aeabi_lasr, .{ .name = "__aeabi_lasr", .linkage = linkage });
411 const __aeabi_llsr = @import("compiler_rt/shift.zig").__aeabi_llsr;
412 @export(__aeabi_llsr, .{ .name = "__aeabi_llsr", .linkage = linkage });
413
414 const __aeabi_fcmpeq = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpeq;
415 @export(__aeabi_fcmpeq, .{ .name = "__aeabi_fcmpeq", .linkage = linkage });
416 const __aeabi_fcmplt = @import("compiler_rt/compareXf2.zig").__aeabi_fcmplt;
417 @export(__aeabi_fcmplt, .{ .name = "__aeabi_fcmplt", .linkage = linkage });
418 const __aeabi_fcmple = @import("compiler_rt/compareXf2.zig").__aeabi_fcmple;
419 @export(__aeabi_fcmple, .{ .name = "__aeabi_fcmple", .linkage = linkage });
420 const __aeabi_fcmpge = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpge;
421 @export(__aeabi_fcmpge, .{ .name = "__aeabi_fcmpge", .linkage = linkage });
422 const __aeabi_fcmpgt = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpgt;
423 @export(__aeabi_fcmpgt, .{ .name = "__aeabi_fcmpgt", .linkage = linkage });
424 const __aeabi_fcmpun = @import("compiler_rt/compareXf2.zig").__aeabi_fcmpun;
425 @export(__aeabi_fcmpun, .{ .name = "__aeabi_fcmpun", .linkage = linkage });
426
427 const __aeabi_dcmpeq = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpeq;
428 @export(__aeabi_dcmpeq, .{ .name = "__aeabi_dcmpeq", .linkage = linkage });
429 const __aeabi_dcmplt = @import("compiler_rt/compareXf2.zig").__aeabi_dcmplt;
430 @export(__aeabi_dcmplt, .{ .name = "__aeabi_dcmplt", .linkage = linkage });
431 const __aeabi_dcmple = @import("compiler_rt/compareXf2.zig").__aeabi_dcmple;
432 @export(__aeabi_dcmple, .{ .name = "__aeabi_dcmple", .linkage = linkage });
433 const __aeabi_dcmpge = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpge;
434 @export(__aeabi_dcmpge, .{ .name = "__aeabi_dcmpge", .linkage = linkage });
435 const __aeabi_dcmpgt = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpgt;
436 @export(__aeabi_dcmpgt, .{ .name = "__aeabi_dcmpgt", .linkage = linkage });
437 const __aeabi_dcmpun = @import("compiler_rt/compareXf2.zig").__aeabi_dcmpun;
438 @export(__aeabi_dcmpun, .{ .name = "__aeabi_dcmpun", .linkage = linkage });
275439 }
276440
277441 if (arch == .i386 and abi == .msvc) {
278442 // Don't let LLVM apply the stdcall name mangling on those MSVC builtins
279 @export(@import("compiler_rt/aulldiv.zig")._alldiv, .{ .name = "\x01__alldiv", .linkage = strong_linkage });
280 @export(@import("compiler_rt/aulldiv.zig")._aulldiv, .{ .name = "\x01__aulldiv", .linkage = strong_linkage });
281 @export(@import("compiler_rt/aullrem.zig")._allrem, .{ .name = "\x01__allrem", .linkage = strong_linkage });
282 @export(@import("compiler_rt/aullrem.zig")._aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage });
443 const _alldiv = @import("compiler_rt/aulldiv.zig")._alldiv;
444 @export(_alldiv, .{ .name = "\x01__alldiv", .linkage = strong_linkage });
445 const _aulldiv = @import("compiler_rt/aulldiv.zig")._aulldiv;
446 @export(_aulldiv, .{ .name = "\x01__aulldiv", .linkage = strong_linkage });
447 const _allrem = @import("compiler_rt/aullrem.zig")._allrem;
448 @export(_allrem, .{ .name = "\x01__allrem", .linkage = strong_linkage });
449 const _aullrem = @import("compiler_rt/aullrem.zig")._aullrem;
450 @export(_aullrem, .{ .name = "\x01__aullrem", .linkage = strong_linkage });
283451 }
284452
285453 if (arch.isSPARC()) {
286454 // SPARC systems use a different naming scheme
287 @export(@import("compiler_rt/sparc.zig")._Qp_add, .{ .name = "_Qp_add", .linkage = linkage });
288 @export(@import("compiler_rt/sparc.zig")._Qp_div, .{ .name = "_Qp_div", .linkage = linkage });
289 @export(@import("compiler_rt/sparc.zig")._Qp_mul, .{ .name = "_Qp_mul", .linkage = linkage });
290 @export(@import("compiler_rt/sparc.zig")._Qp_sub, .{ .name = "_Qp_sub", .linkage = linkage });
291
292 @export(@import("compiler_rt/sparc.zig")._Qp_cmp, .{ .name = "_Qp_cmp", .linkage = linkage });
293 @export(@import("compiler_rt/sparc.zig")._Qp_feq, .{ .name = "_Qp_feq", .linkage = linkage });
294 @export(@import("compiler_rt/sparc.zig")._Qp_fne, .{ .name = "_Qp_fne", .linkage = linkage });
295 @export(@import("compiler_rt/sparc.zig")._Qp_flt, .{ .name = "_Qp_flt", .linkage = linkage });
296 @export(@import("compiler_rt/sparc.zig")._Qp_fle, .{ .name = "_Qp_fle", .linkage = linkage });
297 @export(@import("compiler_rt/sparc.zig")._Qp_fgt, .{ .name = "_Qp_fgt", .linkage = linkage });
298 @export(@import("compiler_rt/sparc.zig")._Qp_fge, .{ .name = "_Qp_fge", .linkage = linkage });
299
300 @export(@import("compiler_rt/sparc.zig")._Qp_itoq, .{ .name = "_Qp_itoq", .linkage = linkage });
301 @export(@import("compiler_rt/sparc.zig")._Qp_uitoq, .{ .name = "_Qp_uitoq", .linkage = linkage });
302 @export(@import("compiler_rt/sparc.zig")._Qp_xtoq, .{ .name = "_Qp_xtoq", .linkage = linkage });
303 @export(@import("compiler_rt/sparc.zig")._Qp_uxtoq, .{ .name = "_Qp_uxtoq", .linkage = linkage });
304 @export(@import("compiler_rt/sparc.zig")._Qp_stoq, .{ .name = "_Qp_stoq", .linkage = linkage });
305 @export(@import("compiler_rt/sparc.zig")._Qp_dtoq, .{ .name = "_Qp_dtoq", .linkage = linkage });
306 @export(@import("compiler_rt/sparc.zig")._Qp_qtoi, .{ .name = "_Qp_qtoi", .linkage = linkage });
307 @export(@import("compiler_rt/sparc.zig")._Qp_qtoui, .{ .name = "_Qp_qtoui", .linkage = linkage });
308 @export(@import("compiler_rt/sparc.zig")._Qp_qtox, .{ .name = "_Qp_qtox", .linkage = linkage });
309 @export(@import("compiler_rt/sparc.zig")._Qp_qtoux, .{ .name = "_Qp_qtoux", .linkage = linkage });
310 @export(@import("compiler_rt/sparc.zig")._Qp_qtos, .{ .name = "_Qp_qtos", .linkage = linkage });
311 @export(@import("compiler_rt/sparc.zig")._Qp_qtod, .{ .name = "_Qp_qtod", .linkage = linkage });
455 const _Qp_add = @import("compiler_rt/sparc.zig")._Qp_add;
456 @export(_Qp_add, .{ .name = "_Qp_add", .linkage = linkage });
457 const _Qp_div = @import("compiler_rt/sparc.zig")._Qp_div;
458 @export(_Qp_div, .{ .name = "_Qp_div", .linkage = linkage });
459 const _Qp_mul = @import("compiler_rt/sparc.zig")._Qp_mul;
460 @export(_Qp_mul, .{ .name = "_Qp_mul", .linkage = linkage });
461 const _Qp_sub = @import("compiler_rt/sparc.zig")._Qp_sub;
462 @export(_Qp_sub, .{ .name = "_Qp_sub", .linkage = linkage });
463
464 const _Qp_cmp = @import("compiler_rt/sparc.zig")._Qp_cmp;
465 @export(_Qp_cmp, .{ .name = "_Qp_cmp", .linkage = linkage });
466 const _Qp_feq = @import("compiler_rt/sparc.zig")._Qp_feq;
467 @export(_Qp_feq, .{ .name = "_Qp_feq", .linkage = linkage });
468 const _Qp_fne = @import("compiler_rt/sparc.zig")._Qp_fne;
469 @export(_Qp_fne, .{ .name = "_Qp_fne", .linkage = linkage });
470 const _Qp_flt = @import("compiler_rt/sparc.zig")._Qp_flt;
471 @export(_Qp_flt, .{ .name = "_Qp_flt", .linkage = linkage });
472 const _Qp_fle = @import("compiler_rt/sparc.zig")._Qp_fle;
473 @export(_Qp_fle, .{ .name = "_Qp_fle", .linkage = linkage });
474 const _Qp_fgt = @import("compiler_rt/sparc.zig")._Qp_fgt;
475 @export(_Qp_fgt, .{ .name = "_Qp_fgt", .linkage = linkage });
476 const _Qp_fge = @import("compiler_rt/sparc.zig")._Qp_fge;
477 @export(_Qp_fge, .{ .name = "_Qp_fge", .linkage = linkage });
478
479 const _Qp_itoq = @import("compiler_rt/sparc.zig")._Qp_itoq;
480 @export(_Qp_itoq, .{ .name = "_Qp_itoq", .linkage = linkage });
481 const _Qp_uitoq = @import("compiler_rt/sparc.zig")._Qp_uitoq;
482 @export(_Qp_uitoq, .{ .name = "_Qp_uitoq", .linkage = linkage });
483 const _Qp_xtoq = @import("compiler_rt/sparc.zig")._Qp_xtoq;
484 @export(_Qp_xtoq, .{ .name = "_Qp_xtoq", .linkage = linkage });
485 const _Qp_uxtoq = @import("compiler_rt/sparc.zig")._Qp_uxtoq;
486 @export(_Qp_uxtoq, .{ .name = "_Qp_uxtoq", .linkage = linkage });
487 const _Qp_stoq = @import("compiler_rt/sparc.zig")._Qp_stoq;
488 @export(_Qp_stoq, .{ .name = "_Qp_stoq", .linkage = linkage });
489 const _Qp_dtoq = @import("compiler_rt/sparc.zig")._Qp_dtoq;
490 @export(_Qp_dtoq, .{ .name = "_Qp_dtoq", .linkage = linkage });
491 const _Qp_qtoi = @import("compiler_rt/sparc.zig")._Qp_qtoi;
492 @export(_Qp_qtoi, .{ .name = "_Qp_qtoi", .linkage = linkage });
493 const _Qp_qtoui = @import("compiler_rt/sparc.zig")._Qp_qtoui;
494 @export(_Qp_qtoui, .{ .name = "_Qp_qtoui", .linkage = linkage });
495 const _Qp_qtox = @import("compiler_rt/sparc.zig")._Qp_qtox;
496 @export(_Qp_qtox, .{ .name = "_Qp_qtox", .linkage = linkage });
497 const _Qp_qtoux = @import("compiler_rt/sparc.zig")._Qp_qtoux;
498 @export(_Qp_qtoux, .{ .name = "_Qp_qtoux", .linkage = linkage });
499 const _Qp_qtos = @import("compiler_rt/sparc.zig")._Qp_qtos;
500 @export(_Qp_qtos, .{ .name = "_Qp_qtos", .linkage = linkage });
501 const _Qp_qtod = @import("compiler_rt/sparc.zig")._Qp_qtod;
502 @export(_Qp_qtod, .{ .name = "_Qp_qtod", .linkage = linkage });
312503 }
313504
314505 if ((arch == .powerpc or arch.isPPC64()) and !is_test) {
315 @export(@import("compiler_rt/addXf3.zig").__addtf3, .{ .name = "__addkf3", .linkage = linkage });
316 @export(@import("compiler_rt/addXf3.zig").__subtf3, .{ .name = "__subkf3", .linkage = linkage });
317 @export(@import("compiler_rt/mulXf3.zig").__multf3, .{ .name = "__mulkf3", .linkage = linkage });
318 @export(@import("compiler_rt/divtf3.zig").__divtf3, .{ .name = "__divkf3", .linkage = linkage });
319 @export(@import("compiler_rt/extendXfYf2.zig").__extendsftf2, .{ .name = "__extendsfkf2", .linkage = linkage });
320 @export(@import("compiler_rt/extendXfYf2.zig").__extenddftf2, .{ .name = "__extenddfkf2", .linkage = linkage });
321 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfsf2, .{ .name = "__trunckfsf2", .linkage = linkage });
322 @export(@import("compiler_rt/truncXfYf2.zig").__trunctfdf2, .{ .name = "__trunckfdf2", .linkage = linkage });
323 @export(@import("compiler_rt/fixtfdi.zig").__fixtfdi, .{ .name = "__fixkfdi", .linkage = linkage });
324 @export(@import("compiler_rt/fixtfsi.zig").__fixtfsi, .{ .name = "__fixkfsi", .linkage = linkage });
325 @export(@import("compiler_rt/fixunstfsi.zig").__fixunstfsi, .{ .name = "__fixunskfsi", .linkage = linkage });
326 @export(@import("compiler_rt/fixunstfdi.zig").__fixunstfdi, .{ .name = "__fixunskfdi", .linkage = linkage });
327 @export(@import("compiler_rt/floatsiXf.zig").__floatsitf, .{ .name = "__floatsikf", .linkage = linkage });
328 @export(@import("compiler_rt/floatditf.zig").__floatditf, .{ .name = "__floatdikf", .linkage = linkage });
329 @export(@import("compiler_rt/floatunditf.zig").__floatunditf, .{ .name = "__floatundikf", .linkage = linkage });
330 @export(@import("compiler_rt/floatunsitf.zig").__floatunsitf, .{ .name = "__floatunsikf", .linkage = linkage });
331
332 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__eqkf2", .linkage = linkage });
333 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__nekf2", .linkage = linkage });
334 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__gekf2", .linkage = linkage });
335 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__ltkf2", .linkage = linkage });
336 @export(@import("compiler_rt/compareXf2.zig").__letf2, .{ .name = "__lekf2", .linkage = linkage });
337 @export(@import("compiler_rt/compareXf2.zig").__getf2, .{ .name = "__gtkf2", .linkage = linkage });
338 @export(@import("compiler_rt/compareXf2.zig").__unordtf2, .{ .name = "__unordkf2", .linkage = linkage });
506 @export(__addtf3, .{ .name = "__addkf3", .linkage = linkage });
507 @export(__subtf3, .{ .name = "__subkf3", .linkage = linkage });
508 @export(__multf3, .{ .name = "__mulkf3", .linkage = linkage });
509 @export(__divtf3, .{ .name = "__divkf3", .linkage = linkage });
510 @export(__extendsftf2, .{ .name = "__extendsfkf2", .linkage = linkage });
511 @export(__extenddftf2, .{ .name = "__extenddfkf2", .linkage = linkage });
512 @export(__trunctfsf2, .{ .name = "__trunckfsf2", .linkage = linkage });
513 @export(__trunctfdf2, .{ .name = "__trunckfdf2", .linkage = linkage });
514 @export(__fixtfdi, .{ .name = "__fixkfdi", .linkage = linkage });
515 @export(__fixtfsi, .{ .name = "__fixkfsi", .linkage = linkage });
516 @export(__fixunstfsi, .{ .name = "__fixunskfsi", .linkage = linkage });
517 @export(__fixunstfdi, .{ .name = "__fixunskfdi", .linkage = linkage });
518 @export(__floatsitf, .{ .name = "__floatsikf", .linkage = linkage });
519 @export(__floatditf, .{ .name = "__floatdikf", .linkage = linkage });
520 @export(__floatunditf, .{ .name = "__floatundikf", .linkage = linkage });
521 @export(__floatunsitf, .{ .name = "__floatunsikf", .linkage = linkage });
522
523 @export(__letf2, .{ .name = "__eqkf2", .linkage = linkage });
524 @export(__letf2, .{ .name = "__nekf2", .linkage = linkage });
525 @export(__getf2, .{ .name = "__gekf2", .linkage = linkage });
526 @export(__letf2, .{ .name = "__ltkf2", .linkage = linkage });
527 @export(__letf2, .{ .name = "__lekf2", .linkage = linkage });
528 @export(__getf2, .{ .name = "__gtkf2", .linkage = linkage });
529 @export(__unordtf2, .{ .name = "__unordkf2", .linkage = linkage });
339530 }
340531
341532 if (builtin.os.tag == .windows) {
342533 // Default stack-probe functions emitted by LLVM
343534 if (is_mingw) {
344 @export(@import("compiler_rt/stack_probe.zig")._chkstk, .{ .name = "_alloca", .linkage = strong_linkage });
345 @export(@import("compiler_rt/stack_probe.zig").___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = strong_linkage });
535 const _chkstk = @import("compiler_rt/stack_probe.zig")._chkstk;
536 @export(_chkstk, .{ .name = "_alloca", .linkage = strong_linkage });
537 const ___chkstk_ms = @import("compiler_rt/stack_probe.zig").___chkstk_ms;
538 @export(___chkstk_ms, .{ .name = "___chkstk_ms", .linkage = strong_linkage });
346539 } else if (!builtin.link_libc) {
347540 // This symbols are otherwise exported by MSVCRT.lib
348 @export(@import("compiler_rt/stack_probe.zig")._chkstk, .{ .name = "_chkstk", .linkage = strong_linkage });
349 @export(@import("compiler_rt/stack_probe.zig").__chkstk, .{ .name = "__chkstk", .linkage = strong_linkage });
541 const _chkstk = @import("compiler_rt/stack_probe.zig")._chkstk;
542 @export(_chkstk, .{ .name = "_chkstk", .linkage = strong_linkage });
543 const __chkstk = @import("compiler_rt/stack_probe.zig").__chkstk;
544 @export(__chkstk, .{ .name = "__chkstk", .linkage = strong_linkage });
350545 }
351546
352547 switch (arch) {
353548 .i386 => {
354 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });
355 @export(@import("compiler_rt/modti3.zig").__modti3, .{ .name = "__modti3", .linkage = linkage });
356 @export(@import("compiler_rt/multi3.zig").__multi3, .{ .name = "__multi3", .linkage = linkage });
357 @export(@import("compiler_rt/udivti3.zig").__udivti3, .{ .name = "__udivti3", .linkage = linkage });
358 @export(@import("compiler_rt/udivmodti4.zig").__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });
359 @export(@import("compiler_rt/umodti3.zig").__umodti3, .{ .name = "__umodti3", .linkage = linkage });
549 const __divti3 = @import("compiler_rt/divti3.zig").__divti3;
550 @export(__divti3, .{ .name = "__divti3", .linkage = linkage });
551 const __modti3 = @import("compiler_rt/modti3.zig").__modti3;
552 @export(__modti3, .{ .name = "__modti3", .linkage = linkage });
553 const __multi3 = @import("compiler_rt/multi3.zig").__multi3;
554 @export(__multi3, .{ .name = "__multi3", .linkage = linkage });
555 const __udivti3 = @import("compiler_rt/udivti3.zig").__udivti3;
556 @export(__udivti3, .{ .name = "__udivti3", .linkage = linkage });
557 const __udivmodti4 = @import("compiler_rt/udivmodti4.zig").__udivmodti4;
558 @export(__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });
559 const __umodti3 = @import("compiler_rt/umodti3.zig").__umodti3;
560 @export(__umodti3, .{ .name = "__umodti3", .linkage = linkage });
360561 },
361562 .x86_64 => {
362563 // The "ti" functions must use Vector(2, u64) parameter types to adhere to the ABI
363564 // that LLVM expects compiler-rt to have.
364 @export(@import("compiler_rt/divti3.zig").__divti3_windows_x86_64, .{ .name = "__divti3", .linkage = linkage });
365 @export(@import("compiler_rt/modti3.zig").__modti3_windows_x86_64, .{ .name = "__modti3", .linkage = linkage });
366 @export(@import("compiler_rt/multi3.zig").__multi3_windows_x86_64, .{ .name = "__multi3", .linkage = linkage });
367 @export(@import("compiler_rt/udivti3.zig").__udivti3_windows_x86_64, .{ .name = "__udivti3", .linkage = linkage });
368 @export(@import("compiler_rt/udivmodti4.zig").__udivmodti4_windows_x86_64, .{ .name = "__udivmodti4", .linkage = linkage });
369 @export(@import("compiler_rt/umodti3.zig").__umodti3_windows_x86_64, .{ .name = "__umodti3", .linkage = linkage });
565 const __divti3_windows_x86_64 = @import("compiler_rt/divti3.zig").__divti3_windows_x86_64;
566 @export(__divti3_windows_x86_64, .{ .name = "__divti3", .linkage = linkage });
567 const __modti3_windows_x86_64 = @import("compiler_rt/modti3.zig").__modti3_windows_x86_64;
568 @export(__modti3_windows_x86_64, .{ .name = "__modti3", .linkage = linkage });
569 const __multi3_windows_x86_64 = @import("compiler_rt/multi3.zig").__multi3_windows_x86_64;
570 @export(__multi3_windows_x86_64, .{ .name = "__multi3", .linkage = linkage });
571 const __udivti3_windows_x86_64 = @import("compiler_rt/udivti3.zig").__udivti3_windows_x86_64;
572 @export(__udivti3_windows_x86_64, .{ .name = "__udivti3", .linkage = linkage });
573 const __udivmodti4_windows_x86_64 = @import("compiler_rt/udivmodti4.zig").__udivmodti4_windows_x86_64;
574 @export(__udivmodti4_windows_x86_64, .{ .name = "__udivmodti4", .linkage = linkage });
575 const __umodti3_windows_x86_64 = @import("compiler_rt/umodti3.zig").__umodti3_windows_x86_64;
576 @export(__umodti3_windows_x86_64, .{ .name = "__umodti3", .linkage = linkage });
370577 },
371578 else => {},
372579 }
373580 } else {
374 @export(@import("compiler_rt/divti3.zig").__divti3, .{ .name = "__divti3", .linkage = linkage });
375 @export(@import("compiler_rt/modti3.zig").__modti3, .{ .name = "__modti3", .linkage = linkage });
376 @export(@import("compiler_rt/multi3.zig").__multi3, .{ .name = "__multi3", .linkage = linkage });
377 @export(@import("compiler_rt/udivti3.zig").__udivti3, .{ .name = "__udivti3", .linkage = linkage });
378 @export(@import("compiler_rt/udivmodti4.zig").__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });
379 @export(@import("compiler_rt/umodti3.zig").__umodti3, .{ .name = "__umodti3", .linkage = linkage });
581 const __divti3 = @import("compiler_rt/divti3.zig").__divti3;
582 @export(__divti3, .{ .name = "__divti3", .linkage = linkage });
583 const __modti3 = @import("compiler_rt/modti3.zig").__modti3;
584 @export(__modti3, .{ .name = "__modti3", .linkage = linkage });
585 const __multi3 = @import("compiler_rt/multi3.zig").__multi3;
586 @export(__multi3, .{ .name = "__multi3", .linkage = linkage });
587 const __udivti3 = @import("compiler_rt/udivti3.zig").__udivti3;
588 @export(__udivti3, .{ .name = "__udivti3", .linkage = linkage });
589 const __udivmodti4 = @import("compiler_rt/udivmodti4.zig").__udivmodti4;
590 @export(__udivmodti4, .{ .name = "__udivmodti4", .linkage = linkage });
591 const __umodti3 = @import("compiler_rt/umodti3.zig").__umodti3;
592 @export(__umodti3, .{ .name = "__umodti3", .linkage = linkage });
380593 }
381 @export(@import("compiler_rt/muloti4.zig").__muloti4, .{ .name = "__muloti4", .linkage = linkage });
382 @export(@import("compiler_rt/mulodi4.zig").__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
594 const __muloti4 = @import("compiler_rt/muloti4.zig").__muloti4;
595 @export(__muloti4, .{ .name = "__muloti4", .linkage = linkage });
596 const __mulodi4 = @import("compiler_rt/mulodi4.zig").__mulodi4;
597 @export(__mulodi4, .{ .name = "__mulodi4", .linkage = linkage });
383598}
384599
385600pub usingnamespace @import("compiler_rt/atomics.zig");
lib/std/special/compiler_rt/atomics.zig+85-45
......@@ -148,10 +148,14 @@ fn atomicLoadFn(comptime T: type) fn (*T, i32) callconv(.C) T {
148148
149149comptime {
150150 if (supports_atomic_ops) {
151 @export(atomicLoadFn(u8), .{ .name = "__atomic_load_1", .linkage = linkage });
152 @export(atomicLoadFn(u16), .{ .name = "__atomic_load_2", .linkage = linkage });
153 @export(atomicLoadFn(u32), .{ .name = "__atomic_load_4", .linkage = linkage });
154 @export(atomicLoadFn(u64), .{ .name = "__atomic_load_8", .linkage = linkage });
151 const atomicLoad_u8 = atomicLoadFn(u8);
152 const atomicLoad_u16 = atomicLoadFn(u16);
153 const atomicLoad_u32 = atomicLoadFn(u32);
154 const atomicLoad_u64 = atomicLoadFn(u64);
155 @export(atomicLoad_u8, .{ .name = "__atomic_load_1", .linkage = linkage });
156 @export(atomicLoad_u16, .{ .name = "__atomic_load_2", .linkage = linkage });
157 @export(atomicLoad_u32, .{ .name = "__atomic_load_4", .linkage = linkage });
158 @export(atomicLoad_u64, .{ .name = "__atomic_load_8", .linkage = linkage });
155159 }
156160}
157161
......@@ -171,10 +175,14 @@ fn atomicStoreFn(comptime T: type) fn (*T, T, i32) callconv(.C) void {
171175
172176comptime {
173177 if (supports_atomic_ops) {
174 @export(atomicStoreFn(u8), .{ .name = "__atomic_store_1", .linkage = linkage });
175 @export(atomicStoreFn(u16), .{ .name = "__atomic_store_2", .linkage = linkage });
176 @export(atomicStoreFn(u32), .{ .name = "__atomic_store_4", .linkage = linkage });
177 @export(atomicStoreFn(u64), .{ .name = "__atomic_store_8", .linkage = linkage });
178 const atomicStore_u8 = atomicStoreFn(u8);
179 const atomicStore_u16 = atomicStoreFn(u16);
180 const atomicStore_u32 = atomicStoreFn(u32);
181 const atomicStore_u64 = atomicStoreFn(u64);
182 @export(atomicStore_u8, .{ .name = "__atomic_store_1", .linkage = linkage });
183 @export(atomicStore_u16, .{ .name = "__atomic_store_2", .linkage = linkage });
184 @export(atomicStore_u32, .{ .name = "__atomic_store_4", .linkage = linkage });
185 @export(atomicStore_u64, .{ .name = "__atomic_store_8", .linkage = linkage });
178186 }
179187}
180188
......@@ -196,10 +204,14 @@ fn atomicExchangeFn(comptime T: type) fn (*T, T, i32) callconv(.C) T {
196204
197205comptime {
198206 if (supports_atomic_ops) {
199 @export(atomicExchangeFn(u8), .{ .name = "__atomic_exchange_1", .linkage = linkage });
200 @export(atomicExchangeFn(u16), .{ .name = "__atomic_exchange_2", .linkage = linkage });
201 @export(atomicExchangeFn(u32), .{ .name = "__atomic_exchange_4", .linkage = linkage });
202 @export(atomicExchangeFn(u64), .{ .name = "__atomic_exchange_8", .linkage = linkage });
207 const atomicExchange_u8 = atomicExchangeFn(u8);
208 const atomicExchange_u16 = atomicExchangeFn(u16);
209 const atomicExchange_u32 = atomicExchangeFn(u32);
210 const atomicExchange_u64 = atomicExchangeFn(u64);
211 @export(atomicExchange_u8, .{ .name = "__atomic_exchange_1", .linkage = linkage });
212 @export(atomicExchange_u16, .{ .name = "__atomic_exchange_2", .linkage = linkage });
213 @export(atomicExchange_u32, .{ .name = "__atomic_exchange_4", .linkage = linkage });
214 @export(atomicExchange_u64, .{ .name = "__atomic_exchange_8", .linkage = linkage });
203215 }
204216}
205217
......@@ -229,10 +241,14 @@ fn atomicCompareExchangeFn(comptime T: type) fn (*T, *T, T, i32, i32) callconv(.
229241
230242comptime {
231243 if (supports_atomic_ops) {
232 @export(atomicCompareExchangeFn(u8), .{ .name = "__atomic_compare_exchange_1", .linkage = linkage });
233 @export(atomicCompareExchangeFn(u16), .{ .name = "__atomic_compare_exchange_2", .linkage = linkage });
234 @export(atomicCompareExchangeFn(u32), .{ .name = "__atomic_compare_exchange_4", .linkage = linkage });
235 @export(atomicCompareExchangeFn(u64), .{ .name = "__atomic_compare_exchange_8", .linkage = linkage });
244 const atomicCompareExchange_u8 = atomicCompareExchangeFn(u8);
245 const atomicCompareExchange_u16 = atomicCompareExchangeFn(u16);
246 const atomicCompareExchange_u32 = atomicCompareExchangeFn(u32);
247 const atomicCompareExchange_u64 = atomicCompareExchangeFn(u64);
248 @export(atomicCompareExchange_u8, .{ .name = "__atomic_compare_exchange_1", .linkage = linkage });
249 @export(atomicCompareExchange_u16, .{ .name = "__atomic_compare_exchange_2", .linkage = linkage });
250 @export(atomicCompareExchange_u32, .{ .name = "__atomic_compare_exchange_4", .linkage = linkage });
251 @export(atomicCompareExchange_u64, .{ .name = "__atomic_compare_exchange_8", .linkage = linkage });
236252 }
237253}
238254
......@@ -264,34 +280,58 @@ fn fetchFn(comptime T: type, comptime op: builtin.AtomicRmwOp) fn (*T, T, i32) c
264280
265281comptime {
266282 if (supports_atomic_ops) {
267 @export(fetchFn(u8, .Add), .{ .name = "__atomic_fetch_add_1", .linkage = linkage });
268 @export(fetchFn(u16, .Add), .{ .name = "__atomic_fetch_add_2", .linkage = linkage });
269 @export(fetchFn(u32, .Add), .{ .name = "__atomic_fetch_add_4", .linkage = linkage });
270 @export(fetchFn(u64, .Add), .{ .name = "__atomic_fetch_add_8", .linkage = linkage });
271
272 @export(fetchFn(u8, .Sub), .{ .name = "__atomic_fetch_sub_1", .linkage = linkage });
273 @export(fetchFn(u16, .Sub), .{ .name = "__atomic_fetch_sub_2", .linkage = linkage });
274 @export(fetchFn(u32, .Sub), .{ .name = "__atomic_fetch_sub_4", .linkage = linkage });
275 @export(fetchFn(u64, .Sub), .{ .name = "__atomic_fetch_sub_8", .linkage = linkage });
276
277 @export(fetchFn(u8, .And), .{ .name = "__atomic_fetch_and_1", .linkage = linkage });
278 @export(fetchFn(u16, .And), .{ .name = "__atomic_fetch_and_2", .linkage = linkage });
279 @export(fetchFn(u32, .And), .{ .name = "__atomic_fetch_and_4", .linkage = linkage });
280 @export(fetchFn(u64, .And), .{ .name = "__atomic_fetch_and_8", .linkage = linkage });
281
282 @export(fetchFn(u8, .Or), .{ .name = "__atomic_fetch_or_1", .linkage = linkage });
283 @export(fetchFn(u16, .Or), .{ .name = "__atomic_fetch_or_2", .linkage = linkage });
284 @export(fetchFn(u32, .Or), .{ .name = "__atomic_fetch_or_4", .linkage = linkage });
285 @export(fetchFn(u64, .Or), .{ .name = "__atomic_fetch_or_8", .linkage = linkage });
286
287 @export(fetchFn(u8, .Xor), .{ .name = "__atomic_fetch_xor_1", .linkage = linkage });
288 @export(fetchFn(u16, .Xor), .{ .name = "__atomic_fetch_xor_2", .linkage = linkage });
289 @export(fetchFn(u32, .Xor), .{ .name = "__atomic_fetch_xor_4", .linkage = linkage });
290 @export(fetchFn(u64, .Xor), .{ .name = "__atomic_fetch_xor_8", .linkage = linkage });
291
292 @export(fetchFn(u8, .Nand), .{ .name = "__atomic_fetch_nand_1", .linkage = linkage });
293 @export(fetchFn(u16, .Nand), .{ .name = "__atomic_fetch_nand_2", .linkage = linkage });
294 @export(fetchFn(u32, .Nand), .{ .name = "__atomic_fetch_nand_4", .linkage = linkage });
295 @export(fetchFn(u64, .Nand), .{ .name = "__atomic_fetch_nand_8", .linkage = linkage });
283 const fetch_add_u8 = fetchFn(u8, .Add);
284 const fetch_add_u16 = fetchFn(u16, .Add);
285 const fetch_add_u32 = fetchFn(u32, .Add);
286 const fetch_add_u64 = fetchFn(u64, .Add);
287 @export(fetch_add_u8, .{ .name = "__atomic_fetch_add_1", .linkage = linkage });
288 @export(fetch_add_u16, .{ .name = "__atomic_fetch_add_2", .linkage = linkage });
289 @export(fetch_add_u32, .{ .name = "__atomic_fetch_add_4", .linkage = linkage });
290 @export(fetch_add_u64, .{ .name = "__atomic_fetch_add_8", .linkage = linkage });
291
292 const fetch_sub_u8 = fetchFn(u8, .Sub);
293 const fetch_sub_u16 = fetchFn(u16, .Sub);
294 const fetch_sub_u32 = fetchFn(u32, .Sub);
295 const fetch_sub_u64 = fetchFn(u64, .Sub);
296 @export(fetch_sub_u8, .{ .name = "__atomic_fetch_sub_1", .linkage = linkage });
297 @export(fetch_sub_u16, .{ .name = "__atomic_fetch_sub_2", .linkage = linkage });
298 @export(fetch_sub_u32, .{ .name = "__atomic_fetch_sub_4", .linkage = linkage });
299 @export(fetch_sub_u64, .{ .name = "__atomic_fetch_sub_8", .linkage = linkage });
300
301 const fetch_and_u8 = fetchFn(u8, .And);
302 const fetch_and_u16 = fetchFn(u16, .And);
303 const fetch_and_u32 = fetchFn(u32, .And);
304 const fetch_and_u64 = fetchFn(u64, .And);
305 @export(fetch_and_u8, .{ .name = "__atomic_fetch_and_1", .linkage = linkage });
306 @export(fetch_and_u16, .{ .name = "__atomic_fetch_and_2", .linkage = linkage });
307 @export(fetch_and_u32, .{ .name = "__atomic_fetch_and_4", .linkage = linkage });
308 @export(fetch_and_u64, .{ .name = "__atomic_fetch_and_8", .linkage = linkage });
309
310 const fetch_or_u8 = fetchFn(u8, .Or);
311 const fetch_or_u16 = fetchFn(u16, .Or);
312 const fetch_or_u32 = fetchFn(u32, .Or);
313 const fetch_or_u64 = fetchFn(u64, .Or);
314 @export(fetch_or_u8, .{ .name = "__atomic_fetch_or_1", .linkage = linkage });
315 @export(fetch_or_u16, .{ .name = "__atomic_fetch_or_2", .linkage = linkage });
316 @export(fetch_or_u32, .{ .name = "__atomic_fetch_or_4", .linkage = linkage });
317 @export(fetch_or_u64, .{ .name = "__atomic_fetch_or_8", .linkage = linkage });
318
319 const fetch_xor_u8 = fetchFn(u8, .Xor);
320 const fetch_xor_u16 = fetchFn(u16, .Xor);
321 const fetch_xor_u32 = fetchFn(u32, .Xor);
322 const fetch_xor_u64 = fetchFn(u64, .Xor);
323 @export(fetch_xor_u8, .{ .name = "__atomic_fetch_xor_1", .linkage = linkage });
324 @export(fetch_xor_u16, .{ .name = "__atomic_fetch_xor_2", .linkage = linkage });
325 @export(fetch_xor_u32, .{ .name = "__atomic_fetch_xor_4", .linkage = linkage });
326 @export(fetch_xor_u64, .{ .name = "__atomic_fetch_xor_8", .linkage = linkage });
327
328 const fetch_nand_u8 = fetchFn(u8, .Nand);
329 const fetch_nand_u16 = fetchFn(u16, .Nand);
330 const fetch_nand_u32 = fetchFn(u32, .Nand);
331 const fetch_nand_u64 = fetchFn(u64, .Nand);
332 @export(fetch_nand_u8, .{ .name = "__atomic_fetch_nand_1", .linkage = linkage });
333 @export(fetch_nand_u16, .{ .name = "__atomic_fetch_nand_2", .linkage = linkage });
334 @export(fetch_nand_u32, .{ .name = "__atomic_fetch_nand_4", .linkage = linkage });
335 @export(fetch_nand_u64, .{ .name = "__atomic_fetch_nand_8", .linkage = linkage });
296336 }
297337}
src/AstGen.zig+7-3
......@@ -59,7 +59,7 @@ fn appendRefsAssumeCapacity(astgen: *AstGen, refs: []const Zir.Inst.Ref) void {
5959 astgen.extra.appendSliceAssumeCapacity(coerced);
6060}
6161
62pub fn generate(gpa: *Allocator, tree: ast.Tree) InnerError!Zir {
62pub fn generate(gpa: *Allocator, tree: ast.Tree) Allocator.Error!Zir {
6363 var arena = std.heap.ArenaAllocator.init(gpa);
6464 defer arena.deinit();
6565
......@@ -662,7 +662,7 @@ fn expr(gz: *GenZir, scope: *Scope, rl: ResultLoc, node: ast.Node.Index) InnerEr
662662 const lhs = try expr(gz, scope, .ref, node_datas[node].lhs);
663663 const extra = tree.extraData(node_datas[node].rhs, ast.Node.SliceSentinel);
664664 const start = try expr(gz, scope, .{ .ty = .usize_type }, extra.start);
665 const end = try expr(gz, scope, .{ .ty = .usize_type }, extra.end);
665 const end = if (extra.end != 0) try expr(gz, scope, .{ .ty = .usize_type }, extra.end) else .none;
666666 const sentinel = try expr(gz, scope, .{ .ty = .usize_type }, extra.sentinel);
667667 const result = try gz.addPlNode(.slice_sentinel, node, Zir.Inst.SliceSentinel{
668668 .lhs = lhs,
......@@ -3877,6 +3877,10 @@ fn containerDecl(
38773877 const node_tags = tree.nodes.items(.tag);
38783878 const node_datas = tree.nodes.items(.data);
38793879
3880 const prev_fn_block = astgen.fn_block;
3881 astgen.fn_block = null;
3882 defer astgen.fn_block = prev_fn_block;
3883
38803884 // We must not create any types until Sema. Here the goal is only to generate
38813885 // ZIR for all the field types, alignments, and default value expressions.
38823886
......@@ -3976,7 +3980,7 @@ fn containerDecl(
39763980 .nonexhaustive_node = nonexhaustive_node,
39773981 };
39783982 };
3979 if (counts.total_fields == 0) {
3983 if (counts.total_fields == 0 and counts.nonexhaustive_node == 0) {
39803984 // One can construct an enum with no tags, and it functions the same as `noreturn`. But
39813985 // this is only useful for generic code; when explicitly using `enum {}` syntax, there
39823986 // must be at least one tag.
src/clang.zig+20-20
......@@ -45,7 +45,7 @@ pub const APValueLValueBase = extern struct {
4545 extern fn ZigClangAPValueLValueBase_dyn_cast_Expr(APValueLValueBase) ?*const Expr;
4646};
4747
48pub const APValueKind = extern enum {
48pub const APValueKind = enum(c_int) {
4949 None,
5050 Indeterminate,
5151 Int,
......@@ -105,7 +105,7 @@ pub const APFloat = opaque {
105105 extern fn ZigClangAPFloat_toString(*const APFloat, precision: c_uint, maxPadding: c_uint, truncateZero: bool) [*:0]const u8;
106106};
107107
108pub const APFloatBaseSemantics = extern enum {
108pub const APFloatBaseSemantics = enum(c_int) {
109109 IEEEhalf,
110110 BFloat,
111111 IEEEsingle,
......@@ -1037,7 +1037,7 @@ pub const InitListExpr = opaque {
10371037 extern fn ZigClangInitListExpr_getInitializedFieldInUnion(*const InitListExpr) ?*FieldDecl;
10381038};
10391039
1040pub const BO = extern enum {
1040pub const BO = enum(c_int) {
10411041 PtrMemD,
10421042 PtrMemI,
10431043 Mul,
......@@ -1073,7 +1073,7 @@ pub const BO = extern enum {
10731073 Comma,
10741074};
10751075
1076pub const UO = extern enum {
1076pub const UO = enum(c_int) {
10771077 PostInc,
10781078 PostDec,
10791079 PreInc,
......@@ -1090,7 +1090,7 @@ pub const UO = extern enum {
10901090 Coawait,
10911091};
10921092
1093pub const TypeClass = extern enum {
1093pub const TypeClass = enum(c_int) {
10941094 Adjusted,
10951095 Decayed,
10961096 ConstantArray,
......@@ -1145,7 +1145,7 @@ pub const TypeClass = extern enum {
11451145 ExtVector,
11461146};
11471147
1148const StmtClass = extern enum {
1148const StmtClass = enum(c_int) {
11491149 NoStmtClass,
11501150 GCCAsmStmtClass,
11511151 MSAsmStmtClass,
......@@ -1362,7 +1362,7 @@ const StmtClass = extern enum {
13621362 WhileStmtClass,
13631363};
13641364
1365pub const CK = extern enum {
1365pub const CK = enum(c_int) {
13661366 Dependent,
13671367 BitCast,
13681368 LValueBitCast,
......@@ -1429,7 +1429,7 @@ pub const CK = extern enum {
14291429 IntToOCLSampler,
14301430};
14311431
1432pub const DeclKind = extern enum {
1432pub const DeclKind = enum(c_int) {
14331433 AccessSpec,
14341434 Block,
14351435 Captured,
......@@ -1513,7 +1513,7 @@ pub const DeclKind = extern enum {
15131513 TranslationUnit,
15141514};
15151515
1516pub const BuiltinTypeKind = extern enum {
1516pub const BuiltinTypeKind = enum(c_int) {
15171517 OCLImage1dRO,
15181518 OCLImage1dArrayRO,
15191519 OCLImage1dBufferRO,
......@@ -1687,7 +1687,7 @@ pub const BuiltinTypeKind = extern enum {
16871687 OMPIterator,
16881688};
16891689
1690pub const CallingConv = extern enum {
1690pub const CallingConv = enum(c_int) {
16911691 C,
16921692 X86StdCall,
16931693 X86FastCall,
......@@ -1708,7 +1708,7 @@ pub const CallingConv = extern enum {
17081708 AArch64VectorCall,
17091709};
17101710
1711pub const StorageClass = extern enum {
1711pub const StorageClass = enum(c_int) {
17121712 None,
17131713 Extern,
17141714 Static,
......@@ -1717,7 +1717,7 @@ pub const StorageClass = extern enum {
17171717 Register,
17181718};
17191719
1720pub const APFloat_roundingMode = extern enum(i8) {
1720pub const APFloat_roundingMode = enum(i8) {
17211721 TowardZero = 0,
17221722 NearestTiesToEven = 1,
17231723 TowardPositive = 2,
......@@ -1727,7 +1727,7 @@ pub const APFloat_roundingMode = extern enum(i8) {
17271727 Invalid = -1,
17281728};
17291729
1730pub const StringLiteral_StringKind = extern enum {
1730pub const StringLiteral_StringKind = enum(c_int) {
17311731 Ascii,
17321732 Wide,
17331733 UTF8,
......@@ -1735,7 +1735,7 @@ pub const StringLiteral_StringKind = extern enum {
17351735 UTF32,
17361736};
17371737
1738pub const CharacterLiteral_CharacterKind = extern enum {
1738pub const CharacterLiteral_CharacterKind = enum(c_int) {
17391739 Ascii,
17401740 Wide,
17411741 UTF8,
......@@ -1743,13 +1743,13 @@ pub const CharacterLiteral_CharacterKind = extern enum {
17431743 UTF32,
17441744};
17451745
1746pub const VarDecl_TLSKind = extern enum {
1746pub const VarDecl_TLSKind = enum(c_int) {
17471747 None,
17481748 Static,
17491749 Dynamic,
17501750};
17511751
1752pub const ElaboratedTypeKeyword = extern enum {
1752pub const ElaboratedTypeKeyword = enum(c_int) {
17531753 Struct,
17541754 Interface,
17551755 Union,
......@@ -1759,21 +1759,21 @@ pub const ElaboratedTypeKeyword = extern enum {
17591759 None,
17601760};
17611761
1762pub const PreprocessedEntity_EntityKind = extern enum {
1762pub const PreprocessedEntity_EntityKind = enum(c_int) {
17631763 InvalidKind,
17641764 MacroExpansionKind,
17651765 MacroDefinitionKind,
17661766 InclusionDirectiveKind,
17671767};
17681768
1769pub const Expr_ConstantExprKind = extern enum {
1769pub const Expr_ConstantExprKind = enum(c_int) {
17701770 Normal,
17711771 NonClassTemplateArgument,
17721772 ClassTemplateArgument,
17731773 ImmediateInvocation,
17741774};
17751775
1776pub const UnaryExprOrTypeTrait_Kind = extern enum {
1776pub const UnaryExprOrTypeTrait_Kind = enum(c_int) {
17771777 SizeOf,
17781778 AlignOf,
17791779 VecStep,
......@@ -1781,7 +1781,7 @@ pub const UnaryExprOrTypeTrait_Kind = extern enum {
17811781 PreferredAlignOf,
17821782};
17831783
1784pub const OffsetOfNode_Kind = extern enum {
1784pub const OffsetOfNode_Kind = enum(c_int) {
17851785 Array,
17861786 Field,
17871787 Identifier,
src/codegen/llvm/bindings.zig+9-9
......@@ -131,7 +131,7 @@ extern fn LLVMLookupIntrinsicID(Name: [*]const u8, NameLen: usize) c_uint;
131131pub const disposeMessage = LLVMDisposeMessage;
132132extern fn LLVMDisposeMessage(Message: [*:0]const u8) void;
133133
134pub const VerifierFailureAction = extern enum {
134pub const VerifierFailureAction = enum(c_int) {
135135 AbortProcess,
136136 PrintMessage,
137137 ReturnStatus,
......@@ -228,7 +228,7 @@ pub const Builder = opaque {
228228 extern fn LLVMBuildExtractValue(*const Builder, AggVal: *const Value, Index: c_uint, Name: [*:0]const u8) *const Value;
229229};
230230
231pub const IntPredicate = extern enum {
231pub const IntPredicate = enum(c_int) {
232232 EQ = 32,
233233 NE = 33,
234234 UGT = 34,
......@@ -274,7 +274,7 @@ pub const TargetMachine = opaque {
274274 ) Bool;
275275};
276276
277pub const CodeMode = extern enum {
277pub const CodeMode = enum(c_int) {
278278 Default,
279279 JITDefault,
280280 Tiny,
......@@ -284,14 +284,14 @@ pub const CodeMode = extern enum {
284284 Large,
285285};
286286
287pub const CodeGenOptLevel = extern enum {
287pub const CodeGenOptLevel = enum(c_int) {
288288 None,
289289 Less,
290290 Default,
291291 Aggressive,
292292};
293293
294pub const RelocMode = extern enum {
294pub const RelocMode = enum(c_int) {
295295 Default,
296296 Static,
297297 PIC,
......@@ -301,7 +301,7 @@ pub const RelocMode = extern enum {
301301 ROPI_RWPI,
302302};
303303
304pub const CodeGenFileType = extern enum {
304pub const CodeGenFileType = enum(c_int) {
305305 AssemblyFile,
306306 ObjectFile,
307307};
......@@ -504,7 +504,7 @@ pub const LinkELF = ZigLLDLinkELF;
504504pub const LinkMachO = ZigLLDLinkMachO;
505505pub const LinkWasm = ZigLLDLinkWasm;
506506
507pub const ObjectFormatType = extern enum(c_int) {
507pub const ObjectFormatType = enum(c_int) {
508508 Unknown,
509509 COFF,
510510 ELF,
......@@ -528,7 +528,7 @@ extern fn ZigLLVMWriteArchive(
528528 os_type: OSType,
529529) bool;
530530
531pub const OSType = extern enum(c_int) {
531pub const OSType = enum(c_int) {
532532 UnknownOS,
533533 Ananas,
534534 CloudABI,
......@@ -567,7 +567,7 @@ pub const OSType = extern enum(c_int) {
567567 Emscripten,
568568};
569569
570pub const ArchType = extern enum(c_int) {
570pub const ArchType = enum(c_int) {
571571 UnknownArch,
572572 arm,
573573 armeb,
src/codegen/spirv/spec.zig+31-60
......@@ -3,7 +3,7 @@
33const Version = @import("std").builtin.Version;
44pub const version = Version{ .major = 1, .minor = 5, .patch = 4 };
55pub const magic_number: u32 = 0x07230203;
6pub const Opcode = extern enum(u16) {
6pub const Opcode = enum(u16) {
77 OpNop = 0,
88 OpUndef = 1,
99 OpSourceContinued = 2,
......@@ -382,12 +382,10 @@ pub const Opcode = extern enum(u16) {
382382 OpGroupNonUniformPartitionNV = 5296,
383383 OpWritePackedPrimitiveIndices4x8NV = 5299,
384384 OpReportIntersectionNV = 5334,
385 OpReportIntersectionKHR = 5334,
386385 OpIgnoreIntersectionNV = 5335,
387386 OpTerminateRayNV = 5336,
388387 OpTraceNV = 5337,
389388 OpTypeAccelerationStructureNV = 5341,
390 OpTypeAccelerationStructureKHR = 5341,
391389 OpExecuteCallableNV = 5344,
392390 OpTypeCooperativeMatrixNV = 5358,
393391 OpCooperativeMatrixLoadNV = 5359,
......@@ -432,9 +430,7 @@ pub const Opcode = extern enum(u16) {
432430 OpAssumeTrueKHR = 5630,
433431 OpExpectKHR = 5631,
434432 OpDecorateString = 5632,
435 OpDecorateStringGOOGLE = 5632,
436433 OpMemberDecorateString = 5633,
437 OpMemberDecorateStringGOOGLE = 5633,
438434 OpVmeImageINTEL = 5699,
439435 OpTypeVmeImageINTEL = 5700,
440436 OpTypeAvcImePayloadINTEL = 5701,
......@@ -585,6 +581,9 @@ pub const Opcode = extern enum(u16) {
585581 OpConstantCompositeContinuedINTEL = 6091,
586582 OpSpecConstantCompositeContinuedINTEL = 6092,
587583 _,
584
585 const OpReportIntersectionKHR = OpReportIntersectionNV;
586 const OpTypeAccelerationStructureKHR = OpTypeAccelerationStructureNV;
588587};
589588pub const ImageOperands = packed struct {
590589 Bias: bool align(@alignOf(u32)) = false,
......@@ -926,7 +925,7 @@ pub const FragmentShadingRate = packed struct {
926925 _reserved_bit_30: bool = false,
927926 _reserved_bit_31: bool = false,
928927};
929pub const SourceLanguage = extern enum(u32) {
928pub const SourceLanguage = enum(u32) {
930929 Unknown = 0,
931930 ESSL = 1,
932931 GLSL = 2,
......@@ -935,7 +934,7 @@ pub const SourceLanguage = extern enum(u32) {
935934 HLSL = 5,
936935 _,
937936};
938pub const ExecutionModel = extern enum(u32) {
937pub const ExecutionModel = enum(u32) {
939938 Vertex = 0,
940939 TessellationControl = 1,
941940 TessellationEvaluation = 2,
......@@ -959,23 +958,21 @@ pub const ExecutionModel = extern enum(u32) {
959958 CallableKHR = 5318,
960959 _,
961960};
962pub const AddressingModel = extern enum(u32) {
961pub const AddressingModel = enum(u32) {
963962 Logical = 0,
964963 Physical32 = 1,
965964 Physical64 = 2,
966965 PhysicalStorageBuffer64 = 5348,
967 PhysicalStorageBuffer64EXT = 5348,
968966 _,
969967};
970pub const MemoryModel = extern enum(u32) {
968pub const MemoryModel = enum(u32) {
971969 Simple = 0,
972970 GLSL450 = 1,
973971 OpenCL = 2,
974972 Vulkan = 3,
975 VulkanKHR = 3,
976973 _,
977974};
978pub const ExecutionMode = extern enum(u32) {
975pub const ExecutionMode = enum(u32) {
979976 Invocations = 0,
980977 SpacingEqual = 1,
981978 SpacingFractionalEven = 2,
......@@ -1044,7 +1041,7 @@ pub const ExecutionMode = extern enum(u32) {
10441041 SchedulerTargetFmaxMhzINTEL = 5903,
10451042 _,
10461043};
1047pub const StorageClass = extern enum(u32) {
1044pub const StorageClass = enum(u32) {
10481045 UniformConstant = 0,
10491046 Input = 1,
10501047 Uniform = 2,
......@@ -1058,26 +1055,19 @@ pub const StorageClass = extern enum(u32) {
10581055 AtomicCounter = 10,
10591056 Image = 11,
10601057 StorageBuffer = 12,
1061 CallableDataNV = 5328,
10621058 CallableDataKHR = 5328,
1063 IncomingCallableDataNV = 5329,
10641059 IncomingCallableDataKHR = 5329,
1065 RayPayloadNV = 5338,
10661060 RayPayloadKHR = 5338,
1067 HitAttributeNV = 5339,
10681061 HitAttributeKHR = 5339,
1069 IncomingRayPayloadNV = 5342,
10701062 IncomingRayPayloadKHR = 5342,
1071 ShaderRecordBufferNV = 5343,
10721063 ShaderRecordBufferKHR = 5343,
10731064 PhysicalStorageBuffer = 5349,
1074 PhysicalStorageBufferEXT = 5349,
10751065 CodeSectionINTEL = 5605,
10761066 DeviceOnlyINTEL = 5936,
10771067 HostOnlyINTEL = 5937,
10781068 _,
10791069};
1080pub const Dim = extern enum(u32) {
1070pub const Dim = enum(u32) {
10811071 @"1D" = 0,
10821072 @"2D" = 1,
10831073 @"3D" = 2,
......@@ -1087,7 +1077,7 @@ pub const Dim = extern enum(u32) {
10871077 SubpassData = 6,
10881078 _,
10891079};
1090pub const SamplerAddressingMode = extern enum(u32) {
1080pub const SamplerAddressingMode = enum(u32) {
10911081 None = 0,
10921082 ClampToEdge = 1,
10931083 Clamp = 2,
......@@ -1095,12 +1085,12 @@ pub const SamplerAddressingMode = extern enum(u32) {
10951085 RepeatMirrored = 4,
10961086 _,
10971087};
1098pub const SamplerFilterMode = extern enum(u32) {
1088pub const SamplerFilterMode = enum(u32) {
10991089 Nearest = 0,
11001090 Linear = 1,
11011091 _,
11021092};
1103pub const ImageFormat = extern enum(u32) {
1093pub const ImageFormat = enum(u32) {
11041094 Unknown = 0,
11051095 Rgba32f = 1,
11061096 Rgba16f = 2,
......@@ -1145,7 +1135,7 @@ pub const ImageFormat = extern enum(u32) {
11451135 R64i = 41,
11461136 _,
11471137};
1148pub const ImageChannelOrder = extern enum(u32) {
1138pub const ImageChannelOrder = enum(u32) {
11491139 R = 0,
11501140 A = 1,
11511141 RG = 2,
......@@ -1168,7 +1158,7 @@ pub const ImageChannelOrder = extern enum(u32) {
11681158 ABGR = 19,
11691159 _,
11701160};
1171pub const ImageChannelDataType = extern enum(u32) {
1161pub const ImageChannelDataType = enum(u32) {
11721162 SnormInt8 = 0,
11731163 SnormInt16 = 1,
11741164 UnormInt8 = 2,
......@@ -1188,36 +1178,36 @@ pub const ImageChannelDataType = extern enum(u32) {
11881178 UnormInt101010_2 = 16,
11891179 _,
11901180};
1191pub const FPRoundingMode = extern enum(u32) {
1181pub const FPRoundingMode = enum(u32) {
11921182 RTE = 0,
11931183 RTZ = 1,
11941184 RTP = 2,
11951185 RTN = 3,
11961186 _,
11971187};
1198pub const FPDenormMode = extern enum(u32) {
1188pub const FPDenormMode = enum(u32) {
11991189 Preserve = 0,
12001190 FlushToZero = 1,
12011191 _,
12021192};
1203pub const FPOperationMode = extern enum(u32) {
1193pub const FPOperationMode = enum(u32) {
12041194 IEEE = 0,
12051195 ALT = 1,
12061196 _,
12071197};
1208pub const LinkageType = extern enum(u32) {
1198pub const LinkageType = enum(u32) {
12091199 Export = 0,
12101200 Import = 1,
12111201 LinkOnceODR = 2,
12121202 _,
12131203};
1214pub const AccessQualifier = extern enum(u32) {
1204pub const AccessQualifier = enum(u32) {
12151205 ReadOnly = 0,
12161206 WriteOnly = 1,
12171207 ReadWrite = 2,
12181208 _,
12191209};
1220pub const FunctionParameterAttribute = extern enum(u32) {
1210pub const FunctionParameterAttribute = enum(u32) {
12211211 Zext = 0,
12221212 Sext = 1,
12231213 ByVal = 2,
......@@ -1228,7 +1218,7 @@ pub const FunctionParameterAttribute = extern enum(u32) {
12281218 NoReadWrite = 7,
12291219 _,
12301220};
1231pub const Decoration = extern enum(u32) {
1221pub const Decoration = enum(u32) {
12321222 RelaxedPrecision = 0,
12331223 SpecId = 1,
12341224 Block = 2,
......@@ -1334,7 +1324,7 @@ pub const Decoration = extern enum(u32) {
13341324 VectorComputeCallableFunctionINTEL = 6087,
13351325 _,
13361326};
1337pub const BuiltIn = extern enum(u32) {
1327pub const BuiltIn = enum(u32) {
13381328 Position = 0,
13391329 PointSize = 1,
13401330 ClipDistance = 3,
......@@ -1455,7 +1445,7 @@ pub const BuiltIn = extern enum(u32) {
14551445 SMIDNV = 5377,
14561446 _,
14571447};
1458pub const Scope = extern enum(u32) {
1448pub const Scope = enum(u32) {
14591449 CrossDevice = 0,
14601450 Device = 1,
14611451 Workgroup = 2,
......@@ -1466,7 +1456,7 @@ pub const Scope = extern enum(u32) {
14661456 ShaderCallKHR = 6,
14671457 _,
14681458};
1469pub const GroupOperation = extern enum(u32) {
1459pub const GroupOperation = enum(u32) {
14701460 Reduce = 0,
14711461 InclusiveScan = 1,
14721462 ExclusiveScan = 2,
......@@ -1476,13 +1466,13 @@ pub const GroupOperation = extern enum(u32) {
14761466 PartitionedExclusiveScanNV = 8,
14771467 _,
14781468};
1479pub const KernelEnqueueFlags = extern enum(u32) {
1469pub const KernelEnqueueFlags = enum(u32) {
14801470 NoWait = 0,
14811471 WaitKernel = 1,
14821472 WaitWorkGroup = 2,
14831473 _,
14841474};
1485pub const Capability = extern enum(u32) {
1475pub const Capability = enum(u32) {
14861476 Matrix = 0,
14871477 Shader = 1,
14881478 Geometry = 2,
......@@ -1560,8 +1550,6 @@ pub const Capability = extern enum(u32) {
15601550 WorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
15611551 SubgroupVoteKHR = 4431,
15621552 StorageBuffer16BitAccess = 4433,
1563 StorageUniformBufferBlock16 = 4433,
1564 UniformAndStorageBuffer16BitAccess = 4434,
15651553 StorageUniform16 = 4434,
15661554 StoragePushConstant16 = 4435,
15671555 StorageInputOutput16 = 4436,
......@@ -1592,7 +1580,6 @@ pub const Capability = extern enum(u32) {
15921580 ShaderClockKHR = 5055,
15931581 SampleMaskOverrideCoverageNV = 5249,
15941582 GeometryShaderPassthroughNV = 5251,
1595 ShaderViewportIndexLayerEXT = 5254,
15961583 ShaderViewportIndexLayerNV = 5254,
15971584 ShaderViewportMaskNV = 5255,
15981585 ShaderStereoViewNV = 5259,
......@@ -1602,40 +1589,24 @@ pub const Capability = extern enum(u32) {
16021589 ImageFootprintNV = 5282,
16031590 FragmentBarycentricNV = 5284,
16041591 ComputeDerivativeGroupQuadsNV = 5288,
1605 FragmentDensityEXT = 5291,
16061592 ShadingRateNV = 5291,
16071593 GroupNonUniformPartitionedNV = 5297,
16081594 ShaderNonUniform = 5301,
1609 ShaderNonUniformEXT = 5301,
16101595 RuntimeDescriptorArray = 5302,
1611 RuntimeDescriptorArrayEXT = 5302,
16121596 InputAttachmentArrayDynamicIndexing = 5303,
1613 InputAttachmentArrayDynamicIndexingEXT = 5303,
16141597 UniformTexelBufferArrayDynamicIndexing = 5304,
1615 UniformTexelBufferArrayDynamicIndexingEXT = 5304,
16161598 StorageTexelBufferArrayDynamicIndexing = 5305,
1617 StorageTexelBufferArrayDynamicIndexingEXT = 5305,
16181599 UniformBufferArrayNonUniformIndexing = 5306,
1619 UniformBufferArrayNonUniformIndexingEXT = 5306,
16201600 SampledImageArrayNonUniformIndexing = 5307,
1621 SampledImageArrayNonUniformIndexingEXT = 5307,
16221601 StorageBufferArrayNonUniformIndexing = 5308,
1623 StorageBufferArrayNonUniformIndexingEXT = 5308,
16241602 StorageImageArrayNonUniformIndexing = 5309,
1625 StorageImageArrayNonUniformIndexingEXT = 5309,
16261603 InputAttachmentArrayNonUniformIndexing = 5310,
1627 InputAttachmentArrayNonUniformIndexingEXT = 5310,
16281604 UniformTexelBufferArrayNonUniformIndexing = 5311,
1629 UniformTexelBufferArrayNonUniformIndexingEXT = 5311,
16301605 StorageTexelBufferArrayNonUniformIndexing = 5312,
1631 StorageTexelBufferArrayNonUniformIndexingEXT = 5312,
16321606 RayTracingNV = 5340,
16331607 VulkanMemoryModel = 5345,
1634 VulkanMemoryModelKHR = 5345,
16351608 VulkanMemoryModelDeviceScope = 5346,
1636 VulkanMemoryModelDeviceScopeKHR = 5346,
16371609 PhysicalStorageBufferAddresses = 5347,
1638 PhysicalStorageBufferAddressesEXT = 5347,
16391610 ComputeDerivativeGroupLinearNV = 5350,
16401611 RayTracingProvisionalKHR = 5353,
16411612 CooperativeMatrixNV = 5357,
......@@ -1685,18 +1656,18 @@ pub const Capability = extern enum(u32) {
16851656 LongConstantCompositeINTEL = 6089,
16861657 _,
16871658};
1688pub const RayQueryIntersection = extern enum(u32) {
1659pub const RayQueryIntersection = enum(u32) {
16891660 RayQueryCandidateIntersectionKHR = 0,
16901661 RayQueryCommittedIntersectionKHR = 1,
16911662 _,
16921663};
1693pub const RayQueryCommittedIntersectionType = extern enum(u32) {
1664pub const RayQueryCommittedIntersectionType = enum(u32) {
16941665 RayQueryCommittedIntersectionNoneKHR = 0,
16951666 RayQueryCommittedIntersectionTriangleKHR = 1,
16961667 RayQueryCommittedIntersectionGeneratedKHR = 2,
16971668 _,
16981669};
1699pub const RayQueryCandidateIntersectionType = extern enum(u32) {
1670pub const RayQueryCandidateIntersectionType = enum(u32) {
17001671 RayQueryCandidateIntersectionTriangleKHR = 0,
17011672 RayQueryCandidateIntersectionAABBKHR = 1,
17021673 _,
src/config.zig.in+1-1
......@@ -1,6 +1,6 @@
11pub const have_llvm = true;
22pub const version: [:0]const u8 = "@ZIG_VERSION@";
3pub const semver = try @import("std").SemanticVersion.parse(version);
3pub const semver = @import("std").SemanticVersion.parse(version) catch unreachable;
44pub const enable_logging: bool = @ZIG_ENABLE_LOGGING_BOOL@;
55pub const enable_tracy = false;
66pub const is_stage1 = true;
src/link/MachO.zig+10-10
......@@ -2700,7 +2700,7 @@ fn writeStubHelperPreamble(self: *MachO) !void {
27002700 const this_addr = stub_helper.addr;
27012701 const target_addr = data.addr;
27022702 data_blk: {
2703 const displacement = math.cast(i21, target_addr - this_addr) catch |_| break :data_blk;
2703 const displacement = math.cast(i21, target_addr - this_addr) catch break :data_blk;
27042704 // adr x17, disp
27052705 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.adr(.x17, displacement).toU32());
27062706 // nop
......@@ -2709,7 +2709,7 @@ fn writeStubHelperPreamble(self: *MachO) !void {
27092709 }
27102710 data_blk: {
27112711 const new_this_addr = this_addr + @sizeOf(u32);
2712 const displacement = math.cast(i21, target_addr - new_this_addr) catch |_| break :data_blk;
2712 const displacement = math.cast(i21, target_addr - new_this_addr) catch break :data_blk;
27132713 // nop
27142714 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
27152715 // adr x17, disp
......@@ -2738,8 +2738,8 @@ fn writeStubHelperPreamble(self: *MachO) !void {
27382738 const this_addr = stub_helper.addr + 3 * @sizeOf(u32);
27392739 const target_addr = got.addr;
27402740 binder_blk: {
2741 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :binder_blk;
2742 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;
2741 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :binder_blk;
2742 const literal = math.cast(u18, displacement) catch break :binder_blk;
27432743 // ldr x16, label
27442744 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.ldr(.x16, .{
27452745 .literal = literal,
......@@ -2750,8 +2750,8 @@ fn writeStubHelperPreamble(self: *MachO) !void {
27502750 }
27512751 binder_blk: {
27522752 const new_this_addr = this_addr + @sizeOf(u32);
2753 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :binder_blk;
2754 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;
2753 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :binder_blk;
2754 const literal = math.cast(u18, displacement) catch break :binder_blk;
27552755 // nop
27562756 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.nop().toU32());
27572757 // ldr x16, label
......@@ -2816,8 +2816,8 @@ fn writeStub(self: *MachO, index: u32) !void {
28162816 const this_addr = stub_addr;
28172817 const target_addr = la_ptr_addr;
28182818 inner: {
2819 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :inner;
2820 const literal = math.cast(u18, displacement) catch |_| break :inner;
2819 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :inner;
2820 const literal = math.cast(u18, displacement) catch break :inner;
28212821 // ldr x16, literal
28222822 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.ldr(.x16, .{
28232823 .literal = literal,
......@@ -2828,8 +2828,8 @@ fn writeStub(self: *MachO, index: u32) !void {
28282828 }
28292829 inner: {
28302830 const new_this_addr = this_addr + @sizeOf(u32);
2831 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :inner;
2832 const literal = math.cast(u18, displacement) catch |_| break :inner;
2831 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :inner;
2832 const literal = math.cast(u18, displacement) catch break :inner;
28332833 // nop
28342834 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
28352835 // ldr x16, literal
src/link/MachO/Trie.zig+1-1
......@@ -334,7 +334,7 @@ pub fn finalize(self: *Trie) !void {
334334 self.ordered_nodes.shrinkRetainingCapacity(0);
335335 try self.ordered_nodes.ensureCapacity(self.allocator, self.node_count);
336336
337 comptime const Fifo = std.fifo.LinearFifo(*Node, .{ .Static = std.math.maxInt(u8) });
337 const Fifo = std.fifo.LinearFifo(*Node, .{ .Static = std.math.maxInt(u8) });
338338 var fifo = Fifo.init();
339339 try fifo.writeItem(self.root.?);
340340
src/link/MachO/Zld.zig+10-10
......@@ -1305,7 +1305,7 @@ fn writeStubHelperCommon(self: *Zld) !void {
13051305 const this_addr = stub_helper.addr;
13061306 const target_addr = data.addr + data.size - @sizeOf(u64);
13071307 data_blk: {
1308 const displacement = math.cast(i21, target_addr - this_addr) catch |_| break :data_blk;
1308 const displacement = math.cast(i21, target_addr - this_addr) catch break :data_blk;
13091309 // adr x17, disp
13101310 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.adr(.x17, displacement).toU32());
13111311 // nop
......@@ -1314,7 +1314,7 @@ fn writeStubHelperCommon(self: *Zld) !void {
13141314 }
13151315 data_blk: {
13161316 const new_this_addr = this_addr + @sizeOf(u32);
1317 const displacement = math.cast(i21, target_addr - new_this_addr) catch |_| break :data_blk;
1317 const displacement = math.cast(i21, target_addr - new_this_addr) catch break :data_blk;
13181318 // nop
13191319 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
13201320 // adr x17, disp
......@@ -1339,8 +1339,8 @@ fn writeStubHelperCommon(self: *Zld) !void {
13391339 const this_addr = stub_helper.addr + 3 * @sizeOf(u32);
13401340 const target_addr = (got.addr + dyld_stub_binder.got_index.? * @sizeOf(u64));
13411341 binder_blk: {
1342 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :binder_blk;
1343 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;
1342 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :binder_blk;
1343 const literal = math.cast(u18, displacement) catch break :binder_blk;
13441344 // ldr x16, label
13451345 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.ldr(.x16, .{
13461346 .literal = literal,
......@@ -1351,8 +1351,8 @@ fn writeStubHelperCommon(self: *Zld) !void {
13511351 }
13521352 binder_blk: {
13531353 const new_this_addr = this_addr + @sizeOf(u32);
1354 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :binder_blk;
1355 const literal = math.cast(u18, displacement) catch |_| break :binder_blk;
1354 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :binder_blk;
1355 const literal = math.cast(u18, displacement) catch break :binder_blk;
13561356 // Pad with nop to please division.
13571357 // nop
13581358 mem.writeIntLittle(u32, code[12..16], aarch64.Instruction.nop().toU32());
......@@ -1444,8 +1444,8 @@ fn writeStub(self: *Zld, index: u32) !void {
14441444 const this_addr = stub_addr;
14451445 const target_addr = la_ptr_addr;
14461446 inner: {
1447 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch |_| break :inner;
1448 const literal = math.cast(u18, displacement) catch |_| break :inner;
1447 const displacement = math.divExact(u64, target_addr - this_addr, 4) catch break :inner;
1448 const literal = math.cast(u18, displacement) catch break :inner;
14491449 // ldr x16, literal
14501450 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.ldr(.x16, .{
14511451 .literal = literal,
......@@ -1456,8 +1456,8 @@ fn writeStub(self: *Zld, index: u32) !void {
14561456 }
14571457 inner: {
14581458 const new_this_addr = this_addr + @sizeOf(u32);
1459 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch |_| break :inner;
1460 const literal = math.cast(u18, displacement) catch |_| break :inner;
1459 const displacement = math.divExact(u64, target_addr - new_this_addr, 4) catch break :inner;
1460 const literal = math.cast(u18, displacement) catch break :inner;
14611461 // nop
14621462 mem.writeIntLittle(u32, code[0..4], aarch64.Instruction.nop().toU32());
14631463 // ldr x16, literal
src/main.zig+53-1
......@@ -2923,6 +2923,7 @@ pub const usage_fmt =
29232923 \\ --stdin Format code from stdin; output to stdout
29242924 \\ --check List non-conforming files and exit with an error
29252925 \\ if the list is non-empty
2926 \\ --ast-check Run zig ast-check on every file
29262927 \\
29272928 \\
29282929;
......@@ -2930,6 +2931,7 @@ pub const usage_fmt =
29302931const Fmt = struct {
29312932 seen: SeenMap,
29322933 any_error: bool,
2934 check_ast: bool,
29332935 color: Color,
29342936 gpa: *Allocator,
29352937 out_buffer: std.ArrayList(u8),
......@@ -2942,6 +2944,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {
29422944 var color: Color = .auto;
29432945 var stdin_flag: bool = false;
29442946 var check_flag: bool = false;
2947 var check_ast_flag: bool = false;
29452948 var input_files = ArrayList([]const u8).init(gpa);
29462949 defer input_files.deinit();
29472950
......@@ -2967,6 +2970,8 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {
29672970 stdin_flag = true;
29682971 } else if (mem.eql(u8, arg, "--check")) {
29692972 check_flag = true;
2973 } else if (mem.eql(u8, arg, "--ast-check")) {
2974 check_ast_flag = true;
29702975 } else {
29712976 fatal("unrecognized parameter: '{s}'", .{arg});
29722977 }
......@@ -3017,6 +3022,7 @@ pub fn cmdFmt(gpa: *Allocator, args: []const []const u8) !void {
30173022 .gpa = gpa,
30183023 .seen = Fmt.SeenMap.init(gpa),
30193024 .any_error = false,
3025 .check_ast = check_ast_flag,
30203026 .color = color,
30213027 .out_buffer = std.ArrayList(u8).init(gpa),
30223028 };
......@@ -3085,7 +3091,7 @@ fn fmtPathDir(
30853091 while (try dir_it.next()) |entry| {
30863092 const is_dir = entry.kind == .Directory;
30873093
3088 if (is_dir and std.mem.eql(u8, entry.name, "zig-cache")) continue;
3094 if (is_dir and (mem.eql(u8, entry.name, "zig-cache") or mem.eql(u8, entry.name, "zig-out"))) continue;
30893095
30903096 if (is_dir or mem.endsWith(u8, entry.name, ".zig")) {
30913097 const full_path = try fs.path.join(fmt.gpa, &[_][]const u8{ file_path, entry.name });
......@@ -3144,6 +3150,52 @@ fn fmtPathFile(
31443150 return;
31453151 }
31463152
3153 if (fmt.check_ast) {
3154 const Module = @import("Module.zig");
3155 const AstGen = @import("AstGen.zig");
3156
3157 var file: Module.Scope.File = .{
3158 .status = .never_loaded,
3159 .source_loaded = true,
3160 .zir_loaded = false,
3161 .sub_file_path = file_path,
3162 .source = source_code,
3163 .stat_size = stat.size,
3164 .stat_inode = stat.inode,
3165 .stat_mtime = stat.mtime,
3166 .tree = tree,
3167 .tree_loaded = true,
3168 .zir = undefined,
3169 .pkg = undefined,
3170 .root_decl = null,
3171 };
3172
3173 if (stat.size > max_src_size)
3174 return error.FileTooBig;
3175
3176 file.zir = try AstGen.generate(fmt.gpa, file.tree);
3177 file.zir_loaded = true;
3178 defer file.zir.deinit(fmt.gpa);
3179
3180 if (file.zir.hasCompileErrors()) {
3181 var arena_instance = std.heap.ArenaAllocator.init(fmt.gpa);
3182 defer arena_instance.deinit();
3183 var errors = std.ArrayList(Compilation.AllErrors.Message).init(fmt.gpa);
3184 defer errors.deinit();
3185
3186 try Compilation.AllErrors.addZir(&arena_instance.allocator, &errors, &file);
3187 const ttyconf: std.debug.TTY.Config = switch (fmt.color) {
3188 .auto => std.debug.detectTTYConfig(),
3189 .on => .escape_codes,
3190 .off => .no_color,
3191 };
3192 for (errors.items) |full_err_msg| {
3193 full_err_msg.renderToStdErr(ttyconf);
3194 }
3195 fmt.any_error = true;
3196 }
3197 }
3198
31473199 // As a heuristic, we make enough capacity for the same as the input source.
31483200 fmt.out_buffer.shrinkRetainingCapacity(0);
31493201 try fmt.out_buffer.ensureCapacity(source_code.len);
src/stage1.zig+2-2
......@@ -58,7 +58,7 @@ pub const OS = c_int;
5858/// Matches std.builtin.BuildMode
5959pub const BuildMode = c_int;
6060
61pub const TargetSubsystem = extern enum(c_int) {
61pub const TargetSubsystem = enum(c_int) {
6262 Console,
6363 Windows,
6464 Posix,
......@@ -171,7 +171,7 @@ export fn stage2_panic(ptr: [*]const u8, len: usize) void {
171171}
172172
173173// ABI warning
174const Error = extern enum {
174const Error = enum(c_int) {
175175 None,
176176 OutOfMemory,
177177 InvalidFormat,
src/type.zig+4-2
......@@ -6,6 +6,8 @@ const Target = std.Target;
66const Module = @import("Module.zig");
77const log = std.log.scoped(.Type);
88
9const file_struct = @This();
10
911/// This is the raw data, with no bookkeeping, no memory awareness, no de-duplication.
1012/// It's important for this type to be small.
1113/// Types are not de-duplicated, which helps with multi-threading since it obviates the requirement
......@@ -3000,12 +3002,12 @@ pub const Type = extern union {
30003002 };
30013003 }
30023004
3003 pub fn init(comptime t: Tag) Type {
3005 pub fn init(comptime t: Tag) file_struct.Type {
30043006 comptime std.debug.assert(@enumToInt(t) < Tag.no_payload_count);
30053007 return .{ .tag_if_small_enough = @enumToInt(t) };
30063008 }
30073009
3008 pub fn create(comptime t: Tag, ally: *Allocator, data: Data(t)) error{OutOfMemory}!Type {
3010 pub fn create(comptime t: Tag, ally: *Allocator, data: Data(t)) error{OutOfMemory}!file_struct.Type {
30093011 const ptr = try ally.create(t.Type());
30103012 ptr.* = .{
30113013 .base = .{ .tag = t },
src/windows_sdk.zig+1-1
......@@ -12,7 +12,7 @@ pub const ZigWindowsSDK = extern struct {
1212 msvc_lib_dir_ptr: ?[*]const u8,
1313 msvc_lib_dir_len: usize,
1414};
15pub const ZigFindWindowsSdkError = extern enum {
15pub const ZigFindWindowsSdkError = enum(c_int) {
1616 None,
1717 OutOfMemory,
1818 NotFound,
test/behavior/bitcast.zig+2-2
......@@ -22,8 +22,8 @@ fn conv2(x: u32) i32 {
2222 return @bitCast(i32, x);
2323}
2424
25test "@bitCast extern enum to its integer type" {
26 const SOCK = extern enum {
25test "@bitCast enum to its integer type" {
26 const SOCK = enum(c_int) {
2727 A,
2828 B,
2929
test/behavior/bugs/1111.zig+1-1
......@@ -1,4 +1,4 @@
1const Foo = extern enum {
1const Foo = enum(c_int) {
22 Bar = -1,
33};
44
test/behavior/bugs/3046.zig+1-1
......@@ -13,7 +13,7 @@ var some_struct: SomeStruct = undefined;
1313
1414test "fixed" {
1515 some_struct = SomeStruct{
16 .field = couldFail() catch |_| @as(i32, 0),
16 .field = couldFail() catch @as(i32, 0),
1717 };
1818 try expect(some_struct.field == 1);
1919}
test/behavior/cast.zig+1-12
......@@ -560,17 +560,6 @@ test "@intToEnum passed a comptime_int to an enum with one item" {
560560 try expect(x == E.A);
561561}
562562
563test "@intToEnum runtime to an extern enum with duplicate values" {
564 const E = extern enum(u8) {
565 A = 1,
566 B = 1,
567 };
568 var a: u8 = 1;
569 var x = @intToEnum(E, a);
570 try expect(x == E.A);
571 try expect(x == E.B);
572}
573
574563test "@intCast to u0 and use the result" {
575564 const S = struct {
576565 fn doTheTest(zero: u1, one: u1, bigzero: i32) !void {
......@@ -665,7 +654,7 @@ test "*const [N]null u8 to ?[]const u8" {
665654
666655test "peer resolution of string literals" {
667656 const S = struct {
668 const E = extern enum {
657 const E = enum {
669658 a,
670659 b,
671660 c,
test/behavior/enum.zig+1-40
......@@ -2,26 +2,6 @@ const expect = @import("std").testing.expect;
22const mem = @import("std").mem;
33const Tag = @import("std").meta.Tag;
44
5test "extern enum" {
6 const S = struct {
7 const i = extern enum {
8 n = 0,
9 o = 2,
10 p = 4,
11 q = 4,
12 };
13 fn doTheTest(y: c_int) void {
14 var x = i.o;
15 switch (x) {
16 .n, .p => unreachable,
17 .o => {},
18 }
19 }
20 };
21 S.doTheTest(52);
22 comptime S.doTheTest(52);
23}
24
255test "non-exhaustive enum" {
266 const S = struct {
277 const E = enum(u8) {
......@@ -236,11 +216,6 @@ test "@tagName" {
236216 comptime try expect(mem.eql(u8, testEnumTagNameBare(BareNumber.Three), "Three"));
237217}
238218
239test "@tagName extern enum with duplicates" {
240 try expect(mem.eql(u8, testEnumTagNameBare(ExternDuplicates.B), "A"));
241 comptime try expect(mem.eql(u8, testEnumTagNameBare(ExternDuplicates.B), "A"));
242}
243
244219test "@tagName non-exhaustive enum" {
245220 try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));
246221 comptime try expect(mem.eql(u8, testEnumTagNameBare(NonExhaustive.B), "B"));
......@@ -256,11 +231,6 @@ const BareNumber = enum {
256231 Three,
257232};
258233
259const ExternDuplicates = extern enum(u8) {
260 A = 1,
261 B = 1,
262};
263
264234const NonExhaustive = enum(u8) {
265235 A,
266236 B,
......@@ -1018,17 +988,8 @@ test "enum with 1 field but explicit tag type should still have the tag type" {
1018988 comptime try expect(@sizeOf(Enum) == @sizeOf(u8));
1019989}
1020990
1021test "empty extern enum with members" {
1022 const E = extern enum {
1023 A,
1024 B,
1025 C,
1026 };
1027 try expect(@sizeOf(E) == @sizeOf(c_int));
1028}
1029
1030991test "tag name with assigned enum values" {
1031 const LocalFoo = enum {
992 const LocalFoo = enum(u8) {
1032993 A = 1,
1033994 B = 0,
1034995 };
test/behavior/error.zig+1-1
......@@ -394,7 +394,7 @@ test "function pointer with return type that is error union with payload which i
394394 }
395395
396396 fn doTheTest() !void {
397 var x = Foo{ .fun = bar };
397 var x = Foo{ .fun = @This().bar };
398398 try expectError(error.UnspecifiedErr, x.fun(1));
399399 }
400400 };
test/behavior/eval.zig+2-2
......@@ -415,8 +415,8 @@ test "f128 at compile time is lossy" {
415415 try expect(@as(f128, 10384593717069655257060992658440192.0) + 1 == 10384593717069655257060992658440192.0);
416416}
417417
418comptime {
419 try expect(@as(f128, 1 << 113) == 10384593717069655257060992658440192);
418test {
419 comptime try expect(@as(f128, 1 << 113) == 10384593717069655257060992658440192);
420420}
421421
422422pub fn TypeWithCompTimeSlice(comptime field_name: []const u8) type {
test/behavior/generics.zig+3-3
......@@ -45,9 +45,9 @@ test "var params" {
4545 try expect(max_f64(1.2, 3.4) == 3.4);
4646}
4747
48comptime {
49 try expect(max_i32(12, 34) == 34);
50 try expect(max_f64(1.2, 3.4) == 3.4);
48test {
49 comptime try expect(max_i32(12, 34) == 34);
50 comptime try expect(max_f64(1.2, 3.4) == 3.4);
5151}
5252
5353fn max_var(a: anytype, b: anytype) @TypeOf(a + b) {
test/behavior/misc.zig+2-6
......@@ -546,19 +546,15 @@ const PackedUnion = packed union {
546546 a: u8,
547547 b: u32,
548548};
549const PackedEnum = packed enum {
550 A,
551 B,
552};
553549
554550test "packed struct, enum, union parameters in extern function" {
555551 testPackedStuff(&(PackedStruct{
556552 .a = 1,
557553 .b = 2,
558 }), &(PackedUnion{ .a = 1 }), PackedEnum.A);
554 }), &(PackedUnion{ .a = 1 }));
559555}
560556
561export fn testPackedStuff(a: *const PackedStruct, b: *const PackedUnion, c: PackedEnum) void {}
557export fn testPackedStuff(a: *const PackedStruct, b: *const PackedUnion) void {}
562558
563559test "slicing zero length array" {
564560 const s1 = ""[0..];
test/behavior/syntax.zig+1-2
......@@ -4,7 +4,7 @@
44extern var a: c_int;
55extern "c" var b: c_int;
66export var c: c_int = 0;
7threadlocal var d: c_int;
7threadlocal var d: c_int = 0;
88extern threadlocal var e: c_int;
99extern "c" threadlocal var f: c_int;
1010export threadlocal var g: c_int = 0;
......@@ -24,7 +24,6 @@ fn container_init() void {
2424fn type_expr_return1() if (true) A {}
2525fn type_expr_return2() for (true) |_| A {}
2626fn type_expr_return3() while (true) A {}
27fn type_expr_return4() comptime A {}
2827
2928fn switch_cases(x: i32) void {
3029 switch (x) {
test/behavior/type.zig+1-1
......@@ -410,7 +410,7 @@ test "Type.Union from Type.Enum" {
410410}
411411
412412test "Type.Union from regular enum" {
413 const E = enum { working_as_expected = 0 };
413 const E = enum { working_as_expected };
414414 const T = @Type(.{
415415 .Union = .{
416416 .layout = .Auto,
test/behavior/union.zig+1-1
......@@ -776,7 +776,7 @@ test "@unionInit on union w/ tag but no fields" {
776776 };
777777
778778 comptime {
779 try expect(@sizeOf(Data) != 0);
779 std.debug.assert(@sizeOf(Data) != 0);
780780 }
781781
782782 fn doTheTest() !void {
test/stage2/test.zig+14
......@@ -880,6 +880,20 @@ pub fn addCases(ctx: *TestContext) !void {
880880 &.{":3:22: error: redundant comptime keyword in already comptime scope"},
881881 );
882882 }
883 {
884 var case = ctx.exe("try in comptime in struct in test", linux_x64);
885 case.addError(
886 \\test "@unionInit on union w/ tag but no fields" {
887 \\ const S = struct {
888 \\ comptime {
889 \\ try expect(false);
890 \\ }
891 \\ };
892 \\}
893 ,
894 &.{":4:13: error: invalid 'try' outside function scope"},
895 );
896 }
883897 {
884898 var case = ctx.exe("import private", linux_x64);
885899 case.addError(