diff options
| author | drew <reserveblue@protonmail.com> | 2021-11-14 18:28:44 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-11-16 16:51:31 -0700 |
| commit | 9bf1681990fe87a6b2e5fc644a89f1aece304579 (patch) | |
| tree | 45617b8500c741e8de902852c0495b5c20279dbf /test/behavior.zig | |
| parent | 952d865bd231834adad30905c469edc5a46d000a (diff) | |
| download | zig-9bf1681990fe87a6b2e5fc644a89f1aece304579.tar.gz zig-9bf1681990fe87a6b2e5fc644a89f1aece304579.zip | |
C backend: basic big ints, fix airPtrToInt, array references, pointer arithmetic UB with NULL, implement airPtrElemPtr/Val, fix redundant indirection/references with arrays
-add additional test cases that were found to be passing
-add basic int128 test cases which previously did not pass but weren't covered
-most test cases in cast.zig now pass
-i128/u128 or smaller int constants can now be rendered
-unsigned int constants are now always suffixed with 'u' to prevent random compile errors
-pointers with a val tag of 'zero' now just emit a 0 constant which coerces to the pointer type and fixes some warnings with ordered comparisons
-pointers with a val tag of 'one' are now casted back to the pointer type
-support pointers with a u64 val
-fix bug where rendering an array's type will emit more indirection than is needed
-render uint128_t/int128_t manually when needed
-implement ptr_add/sub AIR handlers manually so they manually cast to int types which avoids UB if the result or ptr operand is NULL
-implement airPtrElemVal/Ptr
-airAlloc for arrays will not allocate a ref as the local for the array is already a reference/pointer to the array itself
-fix airPtrToInt by casting to the int type
Diffstat (limited to 'test/behavior.zig')
| -rw-r--r-- | test/behavior.zig | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/test/behavior.zig b/test/behavior.zig index 7cdb8386bc..0abc15035b 100644 --- a/test/behavior.zig +++ b/test/behavior.zig @@ -2,6 +2,7 @@ const builtin = @import("builtin"); test { // Tests that pass for stage1, stage2, and the C backend. + _ = @import("behavior/align.zig"); _ = @import("behavior/basic.zig"); _ = @import("behavior/bitcast.zig"); _ = @import("behavior/bool.zig"); @@ -19,16 +20,18 @@ test { _ = @import("behavior/bugs/4769_b.zig"); _ = @import("behavior/bugs/6850.zig"); _ = @import("behavior/call.zig"); + _ = @import("behavior/cast_c.zig"); _ = @import("behavior/defer.zig"); _ = @import("behavior/enum.zig"); _ = @import("behavior/hasdecl.zig"); _ = @import("behavior/hasfield.zig"); _ = @import("behavior/if.zig"); - _ = @import("behavior/struct.zig"); - _ = @import("behavior/truncate.zig"); + _ = @import("behavior/int128.zig"); _ = @import("behavior/null.zig"); + _ = @import("behavior/pointers.zig"); _ = @import("behavior/ptrcast.zig"); _ = @import("behavior/pub_enum.zig"); + _ = @import("behavior/struct.zig"); _ = @import("behavior/truncate.zig"); _ = @import("behavior/underscore.zig"); _ = @import("behavior/usingnamespace.zig"); @@ -39,7 +42,6 @@ test { if (builtin.object_format != .c) { // Tests that pass for stage1 and stage2 but not the C backend. - _ = @import("behavior/align.zig"); _ = @import("behavior/array.zig"); _ = @import("behavior/atomics.zig"); _ = @import("behavior/basic_llvm.zig"); @@ -60,7 +62,6 @@ test { _ = @import("behavior/maximum_minimum.zig"); _ = @import("behavior/null_llvm.zig"); _ = @import("behavior/optional.zig"); - _ = @import("behavior/pointers.zig"); _ = @import("behavior/popcount.zig"); _ = @import("behavior/saturating_arithmetic.zig"); _ = @import("behavior/sizeof_and_typeof.zig"); |
