Commit Graph

44 Commits (492821781dc34659f694577aacbc853c8839406f)

Author SHA1 Message Date
Josh Wolfe d7492b2c22 somewhat realistic usecase test for shifting strange integer sizes 2018-09-17 20:49:23 -04:00
Andrew Kelley 3d38feded9
fix tagged union with all void payloads but meaningful tag
closes #1322
2018-09-14 00:38:22 -04:00
Andrew Kelley 7dd3c3814d
fix incorrect error union const value generation
closes #1442

zig needed to insert explicit padding into this structure before
it got bitcasted.
2018-09-11 15:16:50 -04:00
Andrew Kelley dd1338b0e6
fix incorrect union const value generation
closes #1381

The union was generated as a 3 byte struct when it needed to be
4 bytes so that the packed struct bitcast could work correctly.

Now it recognizes this situation and adds padding bytes to become
the correct size so that it can fit into an array.
2018-09-11 12:59:39 -04:00
Andrew Kelley 9c169f3cf7
C ABI: support returning large structs on x86_64
also panic instead of emitting bad code for returning small structs

See #1481
2018-09-07 20:09:33 -04:00
Andrew Kelley a3d384e593
add test case for #726 2018-09-05 18:20:04 -04:00
Andrew Kelley 526d8425ab
fix false negative determining if function is generic
This solves the smaller test case of #1421 but the
other test case is still an assertion failure.
2018-08-27 16:14:48 -04:00
Andrew Kelley 4b68ef45af fix incorrectly generating an unused const fn global
closes #1277
2018-08-22 14:31:30 -04:00
kristopher tate 298abbcff8 better support for `_` identifier
* disallow variable declaration of `_`
 * prevent `_` from shadowing itself
 * prevent read access of `_`

closes #1204
closes #1320
2018-08-03 02:57:17 -04:00
Andrew Kelley c91c781952 add behavior tests for cancel semantics 2018-07-30 12:49:53 -04:00
Eduardo Sánchez Muñoz 722b9b9e59 codegen: Store returned value if type is 'handle_is_ptr' and function is not 'first_arg_ret'.
Seems to fix #1230, includes test.
2018-07-14 11:33:01 -04:00
Andrew Kelley d8295c1889 add @popCount intrinsic 2018-07-07 00:25:32 -04:00
Andrew Kelley 8c39cdc89f fix await on early return when return type is struct
previously, await on an early return would try to access the
destroyed coroutine frame; now it copies the result into a
temporary variable before destroying the coroutine frame
2018-07-04 11:51:02 -04:00
Andrew Kelley 11ca38a4e9 fix crash for optional pointer to empty struct
closes #1153
2018-06-26 15:27:41 -04:00
Andrew Kelley 5f38d6e2e9 add casting docs, __extenddftf2, and __extendsftf2 2018-06-21 14:44:35 -04:00
Isaac Hier f1207a8e74 Add test case 2018-06-21 08:32:05 -04:00
Andrew Kelley 472b7ef7e6 disable byval 2018-06-16 19:37:00 -04:00
Andrew Kelley 86adc1ef39 add docs and missing test case for merging error sets
See #367
2018-06-12 19:38:59 -04:00
Andrew Kelley 86a352c45b Merge branch 'master' into pointer-reform 2018-05-13 13:38:03 -04:00
Andrew Kelley a6ae45145f add @newStackCall builtin function
See #1006
2018-05-12 17:35:15 -04:00
Andrew Kelley 6928badd85 Merge branch 'master' into pointer-reform 2018-05-09 23:43:07 -04:00
Andrew Kelley b9e320dd52
Merge pull request #951 from alexnask/reflect_reify
Metaprogramming - @typeInfo [DONE]
2018-05-03 23:02:33 -04:00
Alexandros Naskos 131c133bb7 Fixed inlining determination test (#972)
When deciding wether we should inline a scope, look up the parents until we get to a function definition scope
2018-05-02 21:43:07 -04:00
Alexandros Naskos 1b6e97355d Added type info tests to behavior test listing 2018-05-01 13:31:14 +03:00
Andrew Kelley 76ab1d2b6c support foo.* for ptr deref
See #770
2018-04-30 14:20:56 -04:00
Andrew Kelley 859b10d8bf std.math.ln and std.math.exp use float strict mode
closes #920
2018-04-15 15:22:27 -04:00
Andrew Kelley bcce77700f some return types disqualify comptime fn call caching
closes #828
2018-03-12 12:56:25 -04:00
Andrew Kelley 101b7745c4 add optnone noinline to async functions
this works around LLVM optimization assertion failures.
https://bugs.llvm.org/show_bug.cgi?id=36578

closes #800
2018-03-02 13:40:03 -05:00
Andrew Kelley 36eadb569a run coroutine tests only in Debug mode
LLVM 5.0.1, 6.0.0, and trunk crash when attempting to optimize coroutine code.
So, Zig does not support ReleaseFast or ReleaseSafe for coroutines yet.
Luckily, Clang users are running into the same crashes, so folks from the LLVM
community are working on fixes. If we're really lucky they'll be fixed in 6.0.1.
Otherwise we can hope for 7.0.0.
2018-02-28 18:56:26 -05:00
Andrew Kelley 58dc2b719c better coroutine codegen, now passing first coro test
we have to use the Suspend block with llvm.coro.end to
return from the coro
2018-02-28 18:22:43 -05:00
Andrew Kelley cc26148ba7 fix compiler crash when struct contains...
ptr to another struct which contains original struct
2018-02-15 12:14:20 -05:00
Andrew Kelley 8bc523219c add labeled loops, labeled break, labeled continue. remove goto
closes #346
closes #630

regression: translate-c can no longer translate switch statements.
after #629 we can ressurect and modify the code to utilize arbitrarily
returning from blocks.
2017-12-20 23:00:19 -05:00
Andrew Kelley c9e01412a4 fix compiler crash in a nullable if after an if in...
...a switch prong of a switch with 2 prongs in an else

closes #656
2017-12-14 01:07:23 -05:00
Andrew Kelley f55fdc00fc fix const and volatile qualifiers being dropped sometimes
in the expression `&const a.b`, the const (and/or volatile)
qualifiers would be incorrectly dropped.

closes #655
2017-12-13 21:53:52 -05:00
Andrew Kelley a31b23c46b more compile-time type reflection
See #383
2017-11-03 00:00:57 -04:00
Andrew Kelley 4c306af4eb add test case for previous commit 2017-10-27 01:22:48 -04:00
Andrew Kelley c6295fe9ab remove zigrt
adds test case for #394

partially reverts a32b5929cc
2017-09-30 20:21:57 -04:00
Andrew Kelley 1116d82197 fix bitfield pointer syntax
See #37
2017-08-29 08:35:51 -04:00
scurest 1a63f27247 allow trailing commas
closes #392
2017-06-17 10:34:51 -04:00
Andrew Kelley 865b53f286 fix alignOf builtin
* fix assertion error when type is not yet complete
 * fix alignment value

closes #391
2017-06-15 23:47:05 -04:00
Andrew Kelley 7f0620a20f partial implementation of printing floating point numbers with errol3
also add bitCast builtin function. closes #387
2017-06-14 00:24:25 -04:00
Andrew Kelley 01f066de37 ability to slice ptr to hard coded integer at comptime
closes #369
2017-05-09 22:23:38 -04:00
Andrew Kelley 7c236f6dd8 fix compiler crash when referencing a variable...
...in an if after an if in the 2nd switch prong

closes #355
2017-05-02 12:59:09 -04:00
Andrew Kelley d12f1f5b49 test framework supports name prefix and filter argument
rename self hosted tests to behavior tests
2017-04-19 15:38:12 -04:00