authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2022-01-07 00:06:06-05:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2022-01-07 00:06:06-05:00
logc08b190c6918b33d27ceffe1ab3afd5d7f6370ea
tree6dac2ac254e704b2c984f5135c98cd0fd85d4b15
parent7f4fdcc4fce79cc1277c2a89a6a4136293c1b2e5
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

lint: duplicate import (#10519)


29 files changed, 81 insertions(+), 67 deletions(-)

lib/std/hash.zig+7-7
...@@ -33,11 +33,11 @@ const wyhash = @import("hash/wyhash.zig");...@@ -33,11 +33,11 @@ const wyhash = @import("hash/wyhash.zig");
33pub const Wyhash = wyhash.Wyhash;33pub const Wyhash = wyhash.Wyhash;
3434
35test "hash" {35test "hash" {
36 _ = @import("hash/adler.zig");36 _ = adler;
37 _ = @import("hash/auto_hash.zig");37 _ = auto_hash;
38 _ = @import("hash/crc.zig");38 _ = crc;
39 _ = @import("hash/fnv.zig");39 _ = fnv;
40 _ = @import("hash/murmur.zig");40 _ = murmur;
41 _ = @import("hash/cityhash.zig");41 _ = cityhash;
42 _ = @import("hash/wyhash.zig");42 _ = wyhash;
43}43}
lib/std/special/compiler_rt/int.zig+4-3
...@@ -1,8 +1,9 @@...@@ -1,8 +1,9 @@
1// Builtin functions that operate on integer types1// Builtin functions that operate on integer types
2const builtin = @import("builtin");2const builtin = @import("builtin");
3const testing = @import("std").testing;3const std = @import("std");
4const maxInt = @import("std").math.maxInt;4const testing = std.testing;
5const minInt = @import("std").math.minInt;5const maxInt = std.math.maxInt;
6const minInt = std.math.minInt;
67
7const udivmod = @import("udivmod.zig").udivmod;8const udivmod = @import("udivmod.zig").udivmod;
89
lib/std/special/compiler_rt/multi3.zig+1-1
...@@ -17,7 +17,7 @@ pub fn __multi3(a: i128, b: i128) callconv(.C) i128 {...@@ -17,7 +17,7 @@ pub fn __multi3(a: i128, b: i128) callconv(.C) i128 {
17 return r.all;17 return r.all;
18}18}
1919
20const v128 = @import("std").meta.Vector(2, u64);20const v128 = std.meta.Vector(2, u64);
21pub fn __multi3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 {21pub fn __multi3_windows_x86_64(a: v128, b: v128) callconv(.C) v128 {
22 return @bitCast(v128, @call(.{ .modifier = .always_inline }, __multi3, .{22 return @bitCast(v128, @call(.{ .modifier = .always_inline }, __multi3, .{
23 @bitCast(i128, a),23 @bitCast(i128, a),
lib/std/special/compiler_rt/negsi2_test.zig+3-2
...@@ -1,7 +1,8 @@...@@ -1,7 +1,8 @@
1const std = @import("std");
1const neg = @import("negXi2.zig");2const neg = @import("negXi2.zig");
2const testing = @import("std").testing;3const testing = std.testing;
34
4const print = @import("std").debug.print;5const print = std.debug.print;
56
6fn test__negsi2(a: i32, expected: i32) !void {7fn test__negsi2(a: i32, expected: i32) !void {
7 var result = neg.__negsi2(a);8 var result = neg.__negsi2(a);
lib/std/special/compiler_rt/paritydi2_test.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");
1const parity = @import("parity.zig");2const parity = @import("parity.zig");
2const testing = @import("std").testing;3const testing = std.testing;
34
4fn paritydi2Naive(a: i64) i32 {5fn paritydi2Naive(a: i64) i32 {
5 var x = @bitCast(u64, a);6 var x = @bitCast(u64, a);
...@@ -25,7 +26,7 @@ test "paritydi2" {...@@ -25,7 +26,7 @@ test "paritydi2" {
25 try test__paritydi2(@bitCast(i64, @as(u64, 0xffffffff_fffffffe)));26 try test__paritydi2(@bitCast(i64, @as(u64, 0xffffffff_fffffffe)));
26 try test__paritydi2(@bitCast(i64, @as(u64, 0xffffffff_ffffffff)));27 try test__paritydi2(@bitCast(i64, @as(u64, 0xffffffff_ffffffff)));
2728
28 const RndGen = @import("std").rand.DefaultPrng;29 const RndGen = std.rand.DefaultPrng;
29 var rnd = RndGen.init(42);30 var rnd = RndGen.init(42);
30 var i: u32 = 0;31 var i: u32 = 0;
31 while (i < 10_000) : (i += 1) {32 while (i < 10_000) : (i += 1) {
lib/std/special/compiler_rt/paritysi2_test.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");
1const parity = @import("parity.zig");2const parity = @import("parity.zig");
2const testing = @import("std").testing;3const testing = std.testing;
34
4fn paritysi2Naive(a: i32) i32 {5fn paritysi2Naive(a: i32) i32 {
5 var x = @bitCast(u32, a);6 var x = @bitCast(u32, a);
...@@ -25,7 +26,7 @@ test "paritysi2" {...@@ -25,7 +26,7 @@ test "paritysi2" {
25 try test__paritysi2(@bitCast(i32, @as(u32, 0xfffffffe)));26 try test__paritysi2(@bitCast(i32, @as(u32, 0xfffffffe)));
26 try test__paritysi2(@bitCast(i32, @as(u32, 0xffffffff)));27 try test__paritysi2(@bitCast(i32, @as(u32, 0xffffffff)));
2728
28 const RndGen = @import("std").rand.DefaultPrng;29 const RndGen = std.rand.DefaultPrng;
29 var rnd = RndGen.init(42);30 var rnd = RndGen.init(42);
30 var i: u32 = 0;31 var i: u32 = 0;
31 while (i < 10_000) : (i += 1) {32 while (i < 10_000) : (i += 1) {
lib/std/special/compiler_rt/parityti2_test.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");
1const parity = @import("parity.zig");2const parity = @import("parity.zig");
2const testing = @import("std").testing;3const testing = std.testing;
34
4fn parityti2Naive(a: i128) i32 {5fn parityti2Naive(a: i128) i32 {
5 var x = @bitCast(u128, a);6 var x = @bitCast(u128, a);
...@@ -25,7 +26,7 @@ test "parityti2" {...@@ -25,7 +26,7 @@ test "parityti2" {
25 try test__parityti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_fffffffe)));26 try test__parityti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_fffffffe)));
26 try test__parityti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_ffffffff)));27 try test__parityti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_ffffffff)));
2728
28 const RndGen = @import("std").rand.DefaultPrng;29 const RndGen = std.rand.DefaultPrng;
29 var rnd = RndGen.init(42);30 var rnd = RndGen.init(42);
30 var i: u32 = 0;31 var i: u32 = 0;
31 while (i < 10_000) : (i += 1) {32 while (i < 10_000) : (i += 1) {
lib/std/special/compiler_rt/popcountdi2_test.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");
1const popcount = @import("popcount.zig");2const popcount = @import("popcount.zig");
2const testing = @import("std").testing;3const testing = std.testing;
34
4fn popcountdi2Naive(a: i64) i32 {5fn popcountdi2Naive(a: i64) i32 {
5 var x = a;6 var x = a;
...@@ -24,7 +25,7 @@ test "popcountdi2" {...@@ -24,7 +25,7 @@ test "popcountdi2" {
24 try test__popcountdi2(@bitCast(i64, @as(u64, 0xffffffff_fffffffe)));25 try test__popcountdi2(@bitCast(i64, @as(u64, 0xffffffff_fffffffe)));
25 try test__popcountdi2(@bitCast(i64, @as(u64, 0xffffffff_ffffffff)));26 try test__popcountdi2(@bitCast(i64, @as(u64, 0xffffffff_ffffffff)));
2627
27 const RndGen = @import("std").rand.DefaultPrng;28 const RndGen = std.rand.DefaultPrng;
28 var rnd = RndGen.init(42);29 var rnd = RndGen.init(42);
29 var i: u32 = 0;30 var i: u32 = 0;
30 while (i < 10_000) : (i += 1) {31 while (i < 10_000) : (i += 1) {
lib/std/special/compiler_rt/popcountsi2_test.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");
1const popcount = @import("popcount.zig");2const popcount = @import("popcount.zig");
2const testing = @import("std").testing;3const testing = std.testing;
34
4fn popcountsi2Naive(a: i32) i32 {5fn popcountsi2Naive(a: i32) i32 {
5 var x = a;6 var x = a;
...@@ -24,7 +25,7 @@ test "popcountsi2" {...@@ -24,7 +25,7 @@ test "popcountsi2" {
24 try test__popcountsi2(@bitCast(i32, @as(u32, 0xfffffffe)));25 try test__popcountsi2(@bitCast(i32, @as(u32, 0xfffffffe)));
25 try test__popcountsi2(@bitCast(i32, @as(u32, 0xffffffff)));26 try test__popcountsi2(@bitCast(i32, @as(u32, 0xffffffff)));
2627
27 const RndGen = @import("std").rand.DefaultPrng;28 const RndGen = std.rand.DefaultPrng;
28 var rnd = RndGen.init(42);29 var rnd = RndGen.init(42);
29 var i: u32 = 0;30 var i: u32 = 0;
30 while (i < 10_000) : (i += 1) {31 while (i < 10_000) : (i += 1) {
lib/std/special/compiler_rt/popcountti2_test.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const std = @import("std");
1const popcount = @import("popcount.zig");2const popcount = @import("popcount.zig");
2const testing = @import("std").testing;3const testing = std.testing;
34
4fn popcountti2Naive(a: i128) i32 {5fn popcountti2Naive(a: i128) i32 {
5 var x = a;6 var x = a;
...@@ -24,7 +25,7 @@ test "popcountti2" {...@@ -24,7 +25,7 @@ test "popcountti2" {
24 try test__popcountti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_fffffffe)));25 try test__popcountti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_fffffffe)));
25 try test__popcountti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_ffffffff)));26 try test__popcountti2(@bitCast(i128, @as(u128, 0xffffffff_ffffffff_ffffffff_ffffffff)));
2627
27 const RndGen = @import("std").rand.DefaultPrng;28 const RndGen = std.rand.DefaultPrng;
28 var rnd = RndGen.init(42);29 var rnd = RndGen.init(42);
29 var i: u32 = 0;30 var i: u32 = 0;
30 while (i < 10_000) : (i += 1) {31 while (i < 10_000) : (i += 1) {
lib/std/special/compiler_rt/truncXfYf2_test.zig+3-2
...@@ -1,3 +1,4 @@...@@ -1,3 +1,4 @@
1const std = @import("std");
1const __truncsfhf2 = @import("truncXfYf2.zig").__truncsfhf2;2const __truncsfhf2 = @import("truncXfYf2.zig").__truncsfhf2;
23
3fn test__truncsfhf2(a: u32, expected: u16) !void {4fn test__truncsfhf2(a: u32, expected: u16) !void {
...@@ -217,7 +218,7 @@ fn test__truncdfsf2(a: f64, expected: u32) void {...@@ -217,7 +218,7 @@ fn test__truncdfsf2(a: f64, expected: u32) void {
217 }218 }
218 }219 }
219220
220 @import("std").debug.print("got 0x{x} wanted 0x{x}\n", .{ rep, expected });221 std.debug.print("got 0x{x} wanted 0x{x}\n", .{ rep, expected });
221222
222 @panic("__trunctfsf2 test failure");223 @panic("__trunctfsf2 test failure");
223}224}
...@@ -248,7 +249,7 @@ fn test__trunctfhf2(a: f128, expected: u16) void {...@@ -248,7 +249,7 @@ fn test__trunctfhf2(a: f128, expected: u16) void {
248 return;249 return;
249 }250 }
250251
251 @import("std").debug.print("got 0x{x} wanted 0x{x}\n", .{ rep, expected });252 std.debug.print("got 0x{x} wanted 0x{x}\n", .{ rep, expected });
252253
253 @panic("__trunctfhf2 test failure");254 @panic("__trunctfhf2 test failure");
254}255}
lib/std/special/compiler_rt/udivmod.zig+4-3
...@@ -1,6 +1,7 @@...@@ -1,6 +1,7 @@
1const builtin = @import("builtin");1const builtin = @import("builtin");
2const is_test = builtin.is_test;2const is_test = builtin.is_test;
3const native_endian = builtin.cpu.arch.endian();3const native_endian = builtin.cpu.arch.endian();
4const std = @import("std");
45
5const low = switch (native_endian) {6const low = switch (native_endian) {
6 .Big => 1,7 .Big => 1,
...@@ -13,9 +14,9 @@ pub fn udivmod(comptime DoubleInt: type, a: DoubleInt, b: DoubleInt, maybe_rem:...@@ -13,9 +14,9 @@ pub fn udivmod(comptime DoubleInt: type, a: DoubleInt, b: DoubleInt, maybe_rem:
1314
14 const double_int_bits = @typeInfo(DoubleInt).Int.bits;15 const double_int_bits = @typeInfo(DoubleInt).Int.bits;
15 const single_int_bits = @divExact(double_int_bits, 2);16 const single_int_bits = @divExact(double_int_bits, 2);
16 const SingleInt = @import("std").meta.Int(.unsigned, single_int_bits);17 const SingleInt = std.meta.Int(.unsigned, single_int_bits);
17 const SignedDoubleInt = @import("std").meta.Int(.signed, double_int_bits);18 const SignedDoubleInt = std.meta.Int(.signed, double_int_bits);
18 const Log2SingleInt = @import("std").math.Log2Int(SingleInt);19 const Log2SingleInt = std.math.Log2Int(SingleInt);
1920
20 const n = @ptrCast(*const [2]SingleInt, &a).*; // TODO issue #42121 const n = @ptrCast(*const [2]SingleInt, &a).*; // TODO issue #421
21 const d = @ptrCast(*const [2]SingleInt, &b).*; // TODO issue #42122 const d = @ptrCast(*const [2]SingleInt, &b).*; // TODO issue #421
lib/std/time.zig+1-1
...@@ -287,5 +287,5 @@ test "Timer" {...@@ -287,5 +287,5 @@ test "Timer" {
287}287}
288288
289test {289test {
290 _ = @import("time/epoch.zig");290 _ = epoch;
291}291}
lib/std/valgrind.zig+2-2
...@@ -258,6 +258,6 @@ pub const memcheck = @import("valgrind/memcheck.zig");...@@ -258,6 +258,6 @@ pub const memcheck = @import("valgrind/memcheck.zig");
258pub const callgrind = @import("valgrind/callgrind.zig");258pub const callgrind = @import("valgrind/callgrind.zig");
259259
260test {260test {
261 _ = @import("valgrind/memcheck.zig");261 _ = memcheck;
262 _ = @import("valgrind/callgrind.zig");262 _ = callgrind;
263}263}
lib/std/zig/system/darwin.zig+1-1
...@@ -88,5 +88,5 @@ pub const DarwinSDK = struct {...@@ -88,5 +88,5 @@ pub const DarwinSDK = struct {
88};88};
8989
90test "" {90test "" {
91 _ = @import("darwin/macos.zig");91 _ = macos;
92}92}
src/Compilation.zig+3-2
...@@ -34,6 +34,7 @@ const ThreadPool = @import("ThreadPool.zig");...@@ -34,6 +34,7 @@ const ThreadPool = @import("ThreadPool.zig");
34const WaitGroup = @import("WaitGroup.zig");34const WaitGroup = @import("WaitGroup.zig");
35const libtsan = @import("libtsan.zig");35const libtsan = @import("libtsan.zig");
36const Zir = @import("Zir.zig");36const Zir = @import("Zir.zig");
37const Color = @import("main.zig").Color;
3738
38/// General-purpose allocator. Used for both temporary and long-term storage.39/// General-purpose allocator. Used for both temporary and long-term storage.
39gpa: Allocator,40gpa: Allocator,
...@@ -148,7 +149,7 @@ owned_link_dir: ?std.fs.Dir,...@@ -148,7 +149,7 @@ owned_link_dir: ?std.fs.Dir,
148149
149/// This is for stage1 and should be deleted upon completion of self-hosting.150/// This is for stage1 and should be deleted upon completion of self-hosting.
150/// Don't use this for anything other than stage1 compatibility.151/// Don't use this for anything other than stage1 compatibility.
151color: @import("main.zig").Color = .auto,152color: Color = .auto,
152153
153/// This mutex guards all `Compilation` mutable state.154/// This mutex guards all `Compilation` mutable state.
154mutex: std.Thread.Mutex = .{},155mutex: std.Thread.Mutex = .{},
...@@ -790,7 +791,7 @@ pub const InitOptions = struct {...@@ -790,7 +791,7 @@ pub const InitOptions = struct {
790 machine_code_model: std.builtin.CodeModel = .default,791 machine_code_model: std.builtin.CodeModel = .default,
791 clang_preprocessor_mode: ClangPreprocessorMode = .no,792 clang_preprocessor_mode: ClangPreprocessorMode = .no,
792 /// This is for stage1 and should be deleted upon completion of self-hosting.793 /// This is for stage1 and should be deleted upon completion of self-hosting.
793 color: @import("main.zig").Color = .auto,794 color: Color = .auto,
794 test_filter: ?[]const u8 = null,795 test_filter: ?[]const u8 = null,
795 test_name_prefix: ?[]const u8 = null,796 test_name_prefix: ?[]const u8 = null,
796 subsystem: ?std.Target.SubSystem = null,797 subsystem: ?std.Target.SubSystem = null,
src/mingw.zig+1-1
...@@ -408,7 +408,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {...@@ -408,7 +408,7 @@ pub fn buildImportLib(comp: *Compilation, lib_name: []const u8) !void {
408 errdefer comp.gpa.free(lib_final_path);408 errdefer comp.gpa.free(lib_final_path);
409409
410 const llvm = @import("codegen/llvm/bindings.zig");410 const llvm = @import("codegen/llvm/bindings.zig");
411 const arch_type = @import("target.zig").archToLLVM(target.cpu.arch);411 const arch_type = target_util.archToLLVM(target.cpu.arch);
412 const def_final_path_z = try arena.dupeZ(u8, def_final_path);412 const def_final_path_z = try arena.dupeZ(u8, def_final_path);
413 const lib_final_path_z = try arena.dupeZ(u8, lib_final_path);413 const lib_final_path_z = try arena.dupeZ(u8, lib_final_path);
414 if (llvm.WriteImportLibrary(def_final_path_z.ptr, arch_type, lib_final_path_z.ptr, true)) {414 if (llvm.WriteImportLibrary(def_final_path_z.ptr, arch_type, lib_final_path_z.ptr, true)) {
src/tracy.zig+4-3
...@@ -1,9 +1,10 @@...@@ -1,9 +1,10 @@
1const std = @import("std");1const std = @import("std");
2const builtin = @import("builtin");2const builtin = @import("builtin");
3const build_options = @import("build_options");
34
4pub const enable = if (builtin.is_test) false else @import("build_options").enable_tracy;5pub const enable = if (builtin.is_test) false else build_options.enable_tracy;
5pub const enable_allocation = enable and @import("build_options").enable_tracy_allocation;6pub const enable_allocation = enable and build_options.enable_tracy_allocation;
6pub const enable_callstack = enable and @import("build_options").enable_tracy_callstack;7pub const enable_callstack = enable and build_options.enable_tracy_callstack;
78
8// TODO: make this configurable9// TODO: make this configurable
9const callstack_depth = 10;10const callstack_depth = 10;
src/translate_c.zig+2-2
...@@ -820,7 +820,7 @@ fn visitVarDecl(c: *Context, var_decl: *const clang.VarDecl, mangled_name: ?[]co...@@ -820,7 +820,7 @@ fn visitVarDecl(c: *Context, var_decl: *const clang.VarDecl, mangled_name: ?[]co
820 // The C language specification states that variables with static or threadlocal820 // The C language specification states that variables with static or threadlocal
821 // storage without an initializer are initialized to a zero value.821 // storage without an initializer are initialized to a zero value.
822822
823 // @import("std").mem.zeroes(T)823 // std.mem.zeroes(T)
824 init_node = try Tag.std_mem_zeroes.create(c.arena, type_node);824 init_node = try Tag.std_mem_zeroes.create(c.arena, type_node);
825 }825 }
826826
...@@ -5211,7 +5211,7 @@ const MacroSlicer = struct {...@@ -5211,7 +5211,7 @@ const MacroSlicer = struct {
5211// mapped function exists in `std.zig.c_translation.Macros`5211// mapped function exists in `std.zig.c_translation.Macros`
5212test "Macro matching" {5212test "Macro matching" {
5213 const helper = struct {5213 const helper = struct {
5214 const MacroFunctions = @import("std").zig.c_translation.Macros;5214 const MacroFunctions = std.zig.c_translation.Macros;
5215 fn checkMacro(allocator: mem.Allocator, pattern_list: PatternList, source: []const u8, comptime expected_match: ?[]const u8) !void {5215 fn checkMacro(allocator: mem.Allocator, pattern_list: PatternList, source: []const u8, comptime expected_match: ?[]const u8) !void {
5216 var tok_list = std.ArrayList(CToken).init(allocator);5216 var tok_list = std.ArrayList(CToken).init(allocator);
5217 defer tok_list.deinit();5217 defer tok_list.deinit();
test/behavior/cast.zig+2-4
...@@ -2,6 +2,7 @@ const std = @import("std");...@@ -2,6 +2,7 @@ const std = @import("std");
2const expect = std.testing.expect;2const expect = std.testing.expect;
3const mem = std.mem;3const mem = std.mem;
4const maxInt = std.math.maxInt;4const maxInt = std.math.maxInt;
5const builtin = @import("builtin");
56
6test "int to ptr cast" {7test "int to ptr cast" {
7 const x = @as(usize, 13);8 const x = @as(usize, 13);
...@@ -252,10 +253,7 @@ test "array coersion to undefined at runtime" {...@@ -252,10 +253,7 @@ test "array coersion to undefined at runtime" {
252 @setRuntimeSafety(true);253 @setRuntimeSafety(true);
253254
254 // TODO implement @setRuntimeSafety in stage2255 // TODO implement @setRuntimeSafety in stage2
255 if (@import("builtin").zig_is_stage2 and256 if (builtin.zig_is_stage2 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) {
256 @import("builtin").mode != .Debug and
257 @import("builtin").mode != .ReleaseSafe)
258 {
259 return error.SkipZigTest;257 return error.SkipZigTest;
260 }258 }
261259
test/behavior/enum_stage1.zig+4-3
...@@ -1,6 +1,7 @@...@@ -1,6 +1,7 @@
1const expect = @import("std").testing.expect;1const std = @import("std");
2const mem = @import("std").mem;2const expect = std.testing.expect;
3const Tag = @import("std").meta.Tag;3const mem = std.mem;
4const Tag = std.meta.Tag;
45
5test "enum value allocation" {6test "enum value allocation" {
6 const LargeEnum = enum(u32) {7 const LargeEnum = enum(u32) {
test/behavior/import.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const expect = @import("std").testing.expect;1const std = @import("std");
2const expectEqual = @import("std").testing.expectEqual;2const expect = std.testing.expect;
3const expectEqual = std.testing.expectEqual;
3const a_namespace = @import("import/a_namespace.zig");4const a_namespace = @import("import/a_namespace.zig");
45
5test "call fn via namespace lookup" {6test "call fn via namespace lookup" {
test/behavior/int128.zig+2-4
...@@ -2,6 +2,7 @@ const std = @import("std");...@@ -2,6 +2,7 @@ const std = @import("std");
2const expect = std.testing.expect;2const expect = std.testing.expect;
3const maxInt = std.math.maxInt;3const maxInt = std.math.maxInt;
4const minInt = std.math.minInt;4const minInt = std.math.minInt;
5const builtin = @import("builtin");
56
6test "uint128" {7test "uint128" {
7 var buff: u128 = maxInt(u128);8 var buff: u128 = maxInt(u128);
...@@ -21,10 +22,7 @@ test "undefined 128 bit int" {...@@ -21,10 +22,7 @@ test "undefined 128 bit int" {
21 @setRuntimeSafety(true);22 @setRuntimeSafety(true);
2223
23 // TODO implement @setRuntimeSafety in stage224 // TODO implement @setRuntimeSafety in stage2
24 if (@import("builtin").zig_is_stage2 and25 if (builtin.zig_is_stage2 and builtin.mode != .Debug and builtin.mode != .ReleaseSafe) {
25 @import("builtin").mode != .Debug and
26 @import("builtin").mode != .ReleaseSafe)
27 {
28 return error.SkipZigTest;26 return error.SkipZigTest;
29 }27 }
3028
test/behavior/ref_var_in_if_after_if_2nd_switch_prong.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const expect = @import("std").testing.expect;1const std = @import("std");
2const mem = @import("std").mem;2const expect = std.testing.expect;
3const mem = std.mem;
34
4var ok: bool = false;5var ok: bool = false;
5test "reference a variable in an if after an if in the 2nd switch prong" {6test "reference a variable in an if after an if in the 2nd switch prong" {
test/behavior/reflection.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const expect = @import("std").testing.expect;1const std = @import("std");
2const mem = @import("std").mem;2const expect = std.testing.expect;
3const mem = std.mem;
3const reflection = @This();4const reflection = @This();
45
5test "reflection: function return type, var args, and param types" {6test "reflection: function return type, var args, and param types" {
test/behavior/translate_c_macros.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const expect = @import("std").testing.expect;1const std = @import("std");
2const expectEqual = @import("std").testing.expectEqual;2const expect = std.testing.expect;
3const expectEqual = std.testing.expectEqual;
34
4const h = @cImport(@cInclude("behavior/translate_c_macros.h"));5const h = @cImport(@cInclude("behavior/translate_c_macros.h"));
56
test/behavior/translate_c_macros_stage1.zig+3-2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1const expect = @import("std").testing.expect;1const std = @import("std");
2const expectEqual = @import("std").testing.expectEqual;2const expect = std.testing.expect;
3const expectEqual = std.testing.expectEqual;
34
4const h = @cImport(@cInclude("behavior/translate_c_macros.h"));5const h = @cImport(@cInclude("behavior/translate_c_macros.h"));
56
test/behavior/widening.zig+3-2
...@@ -1,6 +1,7 @@...@@ -1,6 +1,7 @@
1const std = @import("std");1const std = @import("std");
2const expect = std.testing.expect;2const expect = std.testing.expect;
3const mem = std.mem;3const mem = std.mem;
4const builtin = @import("builtin");
45
5test "integer widening" {6test "integer widening" {
6 var a: u8 = 250;7 var a: u8 = 250;
...@@ -30,8 +31,8 @@ test "float widening" {...@@ -30,8 +31,8 @@ test "float widening" {
3031
31test "float widening f16 to f128" {32test "float widening f16 to f128" {
32 // TODO https://github.com/ziglang/zig/issues/328233 // TODO https://github.com/ziglang/zig/issues/3282
33 if (@import("builtin").cpu.arch == .aarch64) return error.SkipZigTest;34 if (builtin.cpu.arch == .aarch64) return error.SkipZigTest;
34 if (@import("builtin").cpu.arch == .powerpc64le) return error.SkipZigTest;35 if (builtin.cpu.arch == .powerpc64le) return error.SkipZigTest;
3536
36 var x: f16 = 12.34;37 var x: f16 = 12.34;
37 var y: f128 = x;38 var y: f128 = x;
test/standalone/install_raw_hex/build.zig+1-2
...@@ -1,9 +1,8 @@...@@ -1,9 +1,8 @@
1const Builder = @import("std").build.Builder;
2const builtin = @import("builtin");1const builtin = @import("builtin");
3const std = @import("std");2const std = @import("std");
4const CheckFileStep = std.build.CheckFileStep;3const CheckFileStep = std.build.CheckFileStep;
54
6pub fn build(b: *Builder) void {5pub fn build(b: *std.build.Builder) void {
7 const target = .{6 const target = .{
8 .cpu_arch = .thumb,7 .cpu_arch = .thumb,
9 .cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m4 },8 .cpu_model = .{ .explicit = &std.Target.arm.cpu.cortex_m4 },