aboutsummaryrefslogtreecommitdiff
path: root/test/cases/eval.zig
AgeCommit message (Collapse)Author
2017-05-20add setFloatMode builtin and std.math.floorAndrew Kelley
* skip installing std/rand_test.zig as it's not needed beyond running the std lib tests * add std.math.floor function * add setFloatMode builtin function to choose between builtin.FloatMode.Optimized (default) and builtin.FloatMode.Strict (Optimized is equivalent to -ffast-math in gcc)
2017-05-19change slicing syntax from ... to ..Andrew Kelley
See #359
2017-05-16add compile error for compile-time integer cast truncating bitsAndrew Kelley
closes #371
2017-05-03change while syntaxAndrew Kelley
Old: ``` while (condition; expression) {} ``` New: ``` while (condition) : (expression) {} ``` This is in preparation to allow nullable and error union types as the condition. See #357
2017-04-10fix for loops not working at compile-timeAndrew Kelley
closes #315
2017-03-31first pass at zig build systemAndrew Kelley
* `zig build --export [obj|lib|exe]` changed to `zig build_obj`, `zig build_lib` and `zig build_exe` respectively. * `--name` parameter is optional when it can be inferred from the root source filename. closes #207 * `zig build` now looks for `build.zig` which interacts with `std.build.Builder` to describe the targets, and then the zig build system prints TODO: build these targets. See #204 * add `@bitcast` which is mainly used for pointer reinterpret casting and make explicit casting not do pointer reinterpretation. Closes #290 * fix debug info for byval parameters * sort command line help options * `std.debug.panic` supports format string printing * add `std.mem.IncrementingAllocator` * fix const ptr to a variable with data changing at runtime. closes #289
2017-03-26add comptime eval for some uint comparisons with 0Andrew Kelley
closes #55
2017-03-26replace "&&" and "||" with "and" and "or"Andrew Kelley
closes #272
2017-03-16introduce new test syntaxAndrew Kelley
* remove setFnTest builtin * add test "name" { ... } syntax * remove --check-unused argument. functions are always lazy now.
2017-02-12slice and array re-work plus some misc. changesAndrew Kelley
* `@truncate` builtin allows casting to the same size integer. It also performs two's complement casting between signed and unsigned integers. * The idiomatic way to convert between bytes and numbers is now `mem.readInt` and `mem.writeInt` instead of an unsafe cast. It works at compile time, is safer, and looks cleaner. * Implicitly casting an array to a slice is allowed only if the slice is const. * Constant pointer values know if their memory is from a compile- time constant value or a compile-time variable. * Cast from [N]u8 to []T no longer allowed, but [N]u8 to []const T still allowed. * Fix inability to pass a mutable pointer to comptime variable at compile-time to a function and have the function modify the memory pointed to by the pointer. * Add the `comptime T: type` parameter back to mem.eql. Prevents accidentally creating instantiations for arrays.
2017-02-11rework compile-time known pointer valuesAndrew Kelley
See #257
2017-02-09lots of miscellaneous things all in one big commitAndrew Kelley
* add `@compileLog(...)` builtin function - Helps debug code running at compile time - See #240 * fix crash when there is an error on the start value of a slice * add implicit cast from int and float types to int and float literals if the value is known at compile time * make array concatenation work with slices in addition to arrays and c string literals * fix compile error message for something not having field access * fix crash when `@setDebugSafety()` was called from a function being evaluated at compile-time * fix compile-time evaluation of overflow math builtins. * avoid debug safety panic handler in builtin.o and compiler_rt.o since we use no debug safety in these modules anyway * add compiler_rt functions for division on ARM - Closes #254 * move default panic handler to std.debug so users can call it manually * std.io.printf supports a width in the format specifier
2017-02-07std.io supports printing integers as hex valuesAndrew Kelley
remove "unnecessary if statement" error this "depends on compile variable" code is too hard to validate, and has false negatives. not worth it right now. std.str removed, instead use std.mem. std.mem.eql and std.mem.sliceEql merged and do not require explicit type argument.
2017-02-02fix behavior when initializing struct with undefinedAndrew Kelley
2017-01-29fix compile time initialization of array with undefinedAndrew Kelley
2017-01-29fix sometimes using wrong outer scope for generating defersAndrew Kelley
2017-01-29fix behavior for comptime and runtime basic block phiAndrew Kelley
2017-01-26fix runtime branching tricking the comptime evaluationAndrew Kelley
closes #167
2017-01-23various fixesAndrew Kelley
* comptime expression is a block expression as it should be * fix var args when number of args passed is 0 * implement const value equality for structs * fix indent when rendering container decl AST * IR: prevent duplicate generation of code when it is partially compile-time evaluated * implement compile time struct field pointer evaluation * fix compile time evaluation of slicing
2017-01-22use comptime instead of inline for var and paramsAndrew Kelley
See #221
2017-01-05self hosted tests import std libraryAndrew Kelley
2016-12-26IR: port all passing tests overAndrew Kelley
2016-12-26IR: pass staticEvalListInit testAndrew Kelley
2016-12-26IR: port more testsAndrew Kelley
2016-12-26IR testing: rename cases3 dir to casesAndrew Kelley