18412 Commits

Author SHA1 Message Date
Koakuma
ae2d6b7eea stage2: sparc64: Add BPr support for airCondBr 2022-05-16 23:17:11 +07:00
Koakuma
e057ff2496 stage2: sparc64: Implement SPARCv9 bpr 2022-05-16 23:17:11 +07:00
Koakuma
8f8853cd4f stage2: sparc64: Implement airLoad/airStore 2022-05-16 23:17:06 +07:00
Koakuma
0b54649cac stage2: sparc64: Implement error value generation 2022-05-16 22:48:49 +07:00
Koakuma
3ab6634370 stage2: sparc64: Implement airAlloc 2022-05-16 22:48:49 +07:00
Koakuma
339b0517b3 stage2: sparc64: Implement SPARCv9 bpcc 2022-05-16 22:48:49 +07:00
Koakuma
5d260eb573 stage2: sparc64: Implement SPARCv9 subcc 2022-05-16 22:47:53 +07:00
Koakuma
2770f9a034 stage2: sparc64: Implement airBr 2022-05-16 22:47:53 +07:00
Koakuma
b6de8d2565 stage2: sparc64: Implement airUnwrapErrPayload 2022-05-16 22:47:53 +07:00
Koakuma
2dc2ab091e stage2: sparc64: Implement airCondBr from flags register 2022-05-16 22:47:53 +07:00
Koakuma
fd781195de stage2: sparc64: Split the conditionals between integer and FP ones
On SPARCv9 the integer and FP conditional branch codes doesn't align
with each other at all, so the two need to be treated separately.
2022-05-16 22:47:52 +07:00
Koakuma
662a61fcc3 stage2: sparc64: Implement airIsErr and airIsNonErr 2022-05-16 22:47:52 +07:00
Jakub Konka
5b03d55c5e x64: rename brk to int3, and MIR to interrupt 2022-05-15 19:52:43 +02:00
Jakub Konka
5f97652da8 x64: remove verbose_mir functionality
Originally I thought interleaving AIR with MIR will be useful, however
as it stands, I have used it very sporadically, and recently, not at
all, and I do not think anyone else is actually using it. If there is
a simple error such as a wrong instruction emitted,
`objdump` is perfectly capable of narrowing it down, while if there's
something more subtle happening, regardless of having `--verbose-mir`
functionality or not, you still gotta go via the debugger which
offers a better view at interleaved source program with the emitted
machine code. Finally, I believe `-femit-asm` when we add it will offer a
more generic substitute.
2022-05-15 18:21:50 +02:00
Luuk de Gram
5138856a72 test harness: Set filename on error return
While calling `next` an error can occur while parsing the file.
However, we don't set the filename that is currently being processed, until `next` completed successfully.
This means that for invalid test names, the wrong filename was being displayed in the panic message.
The fix is to retrieve the correct filename when an error occurs and then setting the filename appropriately.
2022-05-15 09:30:59 +02:00
Robin
1bdcbd18ae
init-exe: add note about log_level in ReleaseSmall and ReleaseFast build mode (#11626)
As suggested in https://github.com/ziglang/zig/issues/9945#issuecomment-950114977 by @wizzard0.

Fixes #9945.
2022-05-14 12:56:58 +02:00
Andrew Kelley
802f220739
Merge pull request #11647 from ziglang/migrate-runtime-safety-tests
migrate runtime safety tests to the new test harness
2022-05-13 23:57:15 -04:00
Andrew Kelley
0cd43b0f86 runtime safety tests only on the native target
This matches master branch. We can look into adding more target coverage
as we switch to stage2. As it stands, this works around having to
duplicate the "Executor" logic to figure out when to not run the tests
due to them being non-native.
2022-05-13 17:59:06 -07:00
Andrew Kelley
7d8b90b905 test harness: actually run the stage1 "run" tests 2022-05-13 17:32:23 -07:00
Andrew Kelley
c30edd78f9 std.Progress: activate() calls maybeRefresh()
This makes the progress bar display the ongoing operation in the case
that the API user calls activate().
2022-05-13 14:31:30 -07:00
Andrew Kelley
b986fcfc99 test-cases: honor -Dtest-filter argument from zig build 2022-05-13 14:31:02 -07:00
Andrew Kelley
f6e9b6620d build.zig: rename a local variable 2022-05-13 14:30:43 -07:00
Andrew Kelley
915032715f test harness: dump stderr when compiler crashes 2022-05-13 14:03:20 -07:00
Andrew Kelley
7755f7863a disable a runtime safety test that is failing on WASI 2022-05-13 14:03:20 -07:00
Andrew Kelley
66f3efb63b migrate runtime safety tests to the new test harness
* migrate runtime safety tests to the new test harness
   - this required adding compare output / execution support for stage1
     to the test harness.
 * rename `zig build test-stage2` to `zig build test-cases` since it now
   does quite a bit of stage1 testing actually. I named it this way
   since the main directory in the source tree associated with these
   tests is "test/cases/".
 * add some documentation for the test manifest format.
2022-05-13 14:03:20 -07:00
Andrew Kelley
f32928c50d
Merge pull request #11641 from erikarvstedt/fixup_rand_float_improvement
Minor fixes for random float generation
2022-05-13 16:50:18 -04:00
Kirk Scheibelhut
24633b5613 zig fmt: make --exclude ignore missing dirs 2022-05-13 16:45:00 -04:00
Koakuma
fb0692334e target: Rename sparcv9 -> sparc64
Rename all references of sparcv9 to sparc64, to make Zig align more with
other projects. Also, added new function to convert glibc arch name to Zig
arch name, since it refers to the architecture as sparcv9.

This is based on the suggestion by @kubkon in PR 11847.
(https://github.com/ziglang/zig/pull/11487#pullrequestreview-963761757)
2022-05-13 16:43:59 -04:00
Jonathan Marler
aceb7e18bd std.os.linux: fix signature of setgroups
the list parameter should be a multi-item pointer rather than a single-item
pointer. see: https://linux.die.net/man/2/setgroups

> setgroups() sets the supplementary group IDs for the calling process...
> the size argument specifies the number of supplementary group IDs in the buffer pointed to by list.
2022-05-13 17:46:56 +02:00
Andrew Kelley
537f905216 fix bad runtime safety test cases
The "slicing operator with sentinel" runtime safety test cases should
all have been compile errors in their current forms. In this commit I
adjust them to use runtime-known slices before triggering the runtime
safety.

Furthermore the test cases did not actually have unique names.
2022-05-12 21:15:41 -07:00
Travis Staloch
974af5f291 add std.math.sign 2022-05-12 16:09:09 -04:00
Erik Arvstedt
23ef7a8060 std.rand.float: simplify leading zero calculations
This saves a `bitwise or` operation in the common case and
removes the (slightly magic) mask constants.
2022-05-12 16:23:39 +02:00
Erik Arvstedt
1d5ea10bee std.rand: fixup 'improve random float generation'
- Test: Fix bucket counting. Previously, the first hit was not counted.
  This off-by-one error slightly increased the mean of `*_total_variance`,
  which decreased the acceptance rate for a particular random seed
  from 95% to 92.6%. (Irrelevant for test failure because the seed is fixed.)
- Improve comments
2022-05-12 15:39:19 +02:00
Andrew Kelley
5c20c7036b
Merge pull request #10796 from marler8997/envmap
Envmap
2022-05-12 02:49:11 -04:00
Jonathan Marler
aef642fc07 remove RtlUpcaseUnicodeString, no longer needed 2022-05-11 18:43:41 -06:00
Jonathan Marler
2ddfe16e1e fix ntdll extern casing
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-05-11 18:41:54 -06:00
Jonathan Marler
a38e6a64d3 document that on Windows, all key arguments in EnvMap must be valid utf8 2022-05-11 18:41:23 -06:00
Jonathan Marler
8492ced075 incorporate review changes from squeek 2022-05-11 18:41:23 -06:00
Jonathan Marler
71f69190ef some fixes to the EnvMap HashContext 2022-05-11 18:41:23 -06:00
Jonathan Marler
1c874a871f reverse some of the now unneeded changes from squeek 2022-05-11 18:41:23 -06:00
Jonathan Marler
e65d8f82c5 add unicode support 2022-05-11 18:41:23 -06:00
Jonathan Marler
69f0a5587d remove extra storage from EnvMap on windows 2022-05-11 18:40:53 -06:00
Ryan Liptak
e70cb04f89 EnvMapWindows: Fix putUtf8 not uppercasing keys 2022-05-11 18:40:53 -06:00
Ryan Liptak
b2b48fbf2c Set EnvMap.Size to BufMap.BufMapHashMap.Size
Now that BufMap.BufMapHashMap is pub, we can just get Size directly
2022-05-11 18:40:53 -06:00
Ryan Liptak
a2069612a5 Fix regression in RunStep.addPathDir
`key` was never being given a value, caused by b83cea12f31feaa0aff9489d5f7bd6159d284567
2022-05-11 18:40:53 -06:00
Ryan Liptak
a65be05a6e Make the BufMap.count return value match its underlying HashMap's Size
Fixes a process.EnvMap compile error on 32-bit architectures
2022-05-11 18:40:53 -06:00
Jonathan Marler
9e89000ffc Update usages of process.getEnvMap and change BufMap -> EnvMap where applicable
# Conflicts:
#	lib/std/build/RunStep.zig
2022-05-11 18:40:53 -06:00
Ryan Liptak
15d5988e69 Add process.EnvMap, a platform-independent environment variable map
EnvMap provides the same API as the previously used BufMap (besides `putMove` and `getPtr`), so usage sites of `getEnvMap` can usually remain unchanged.

For non-Windows, EnvMap is a wrapper around BufMap. On Windows, it uses a new EnvMapWindows to handle some Windows-specific behavior:

- Lookups use Unicode-aware case insensitivity (but `get` cannot return an error because EnvMapWindows has an internal buffer to use for lookup conversions)
- Canonical names are returned when iterating the EnvMap

Fixes #10561, closes #4603
2022-05-11 18:40:53 -06:00
Andrew Kelley
d383b940c2 Revert "add std.rand.RomuTrio"
This reverts commit d1f1f5124f8edb9245394642d89f80c5118a6833.

The unit tests did not pass on `-target mips-linux`.
2022-05-11 13:50:14 -07:00
Francesco Alemanno
d1f1f5124f add std.rand.RomuTrio 2022-05-11 15:52:38 -04:00