88 Commits

Author SHA1 Message Date
Nameless
71c228fe65
std.http: add simple standalone http tests, add state check for http server 2023-05-06 21:35:15 -05:00
Jacob Young
7e0c6d7edc Sema: fix empty infinite loops
Closes #15284
2023-04-17 02:30:10 +03:00
Andrew Kelley
f289277599 Merge remote-tracking branch 'origin/master' into llvm16 2023-04-05 22:05:31 -07:00
dweiller
ff97bd21c3 tests: enable test_runner_module_imports standalone test 2023-03-30 11:53:07 +03:00
Andrew Kelley
8f481dfc3c fix std.Build.OptionsStep
* use the same hash function as the rest of the steps
 * fix race condition due to a macOS oddity.
 * fix race condition due to file truncation (rename into place instead)
 * integrate with marking Step.result_cached. check if the file already
   exists with fs.access before doing anything else.
 * use a directory so that the file basename can be "options.zig"
   instead of a hash digest.
 * better error reporting in case of file system failures.
2023-03-19 00:39:29 -04:00
Andrew Kelley
4d7e77cb17 remove standalone test "issue_9812"
This test has a few problems:

 * I don't want to vendor third party projects into the main compiler
   repository such as kuba-zip just for test cases. If we want to test
   third party projects, that should be a separate repository dedicated
   to that purpose.

 * Ideally tests would be isolated to test a particular thing, rather
   than have a lot of unrelated logic that is not what is primarily
   being tested.

 * Ideally tests will not be named after GitHub issues, but named after
   the thing that is being tested. And not testing for the absence of a
   bug, but for the existence of correct behavior.

Aside from these issues, it's also failing in the LLVM 16 branch:

```
kuba-zip/zip.c:276:16: error: call to undeclared function 'fileno'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
kuba-zip/zip.c:277:14: error: call to undeclared function 'ftruncate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
kuba-zip/zip.c:364:11: error: call to undeclared function 'symlink'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
```

These are not interesting failures related to the thing actually being
tested; this is busywork related to the fact that we vendor third party
code. So, that is why I chose to delete this test case instead of repair
it.
2023-03-16 21:51:58 -07:00
Andrew Kelley
c5cdc0262b add the new extern test to standalone tests
This was from master branch commit
c93e0d86187cb589d6726acd36f741f3d87a96be. Since standalone test are
completely reworked, I had to resolve the merge conflict later, in this
commit.
2023-03-15 10:48:15 -07:00
Andrew Kelley
2956232b42 standalone tests: avoid running on strange target
Without this, aarch64-linux tried to compile this test for
aarch64-windows with the same CPU settings, which is not an intended
test combination.
2023-03-15 10:48:14 -07:00
Andrew Kelley
030742f1f7 re-enable standalone tests based on build.zig 2023-03-15 10:48:14 -07:00
Andrew Kelley
15c4fae1c9 re-enable the simple standalone tests 2023-03-15 10:48:14 -07:00
mlugg
c93e0d8618 Sema: @extern fixes
* There was an edge case where the arena could be destroyed twice on
  error: once from the arena itself and once from the decl destruction.

* The type of the created decl was incorrect (it should have been the
  pointer child type), but it's not required anyway, so it's now just
  initialized to anyopaque (which more accurately reflects what's
  actually at that memory, since e.g. [*]T may correspond to nothing).

* A runtime bitcast of the pointer was performed, meaning @extern didn't
  work at comptime. This is unnecessary: the decl_ref can just be
  initialized with the correct pointer type.
2023-03-12 18:55:23 +02:00
mlugg
f94cbab3ac
Add test coverage for some module structures 2023-02-21 02:05:36 +00:00
Jonathan Marler
0a8fe34b11 add test to ignore sigpipe 2023-02-17 15:25:36 -07:00
dweiller
1f7390f399 fix custom test runner package path resolution
Fixes #13970.

This fix makes test runners resolve package paths relative to the
directory the test runner is in. This means it is not possible to import
a file from outside the file tree root at the directory containing the
test runner.
2023-02-08 14:30:37 +11:00
Andrew Kelley
11cc1c16fa make @embedFile support module-mapped names the same way as @import
closes #14553
2023-02-05 03:25:43 -05:00
Jan Philipp Hafer
301a89849b tools: build all tools in ci to prevent bitrot
No LLVM assertions were triggered for me.
Closes #12015
Closes #12022
Closes #12223
2023-01-06 01:18:46 +02:00
Andrew Kelley
9bcd48e40e Revert "make a .rsp file for zig clang"
This reverts commit 9db293492bbbc5b8d70638bd9c59dea19d13596c.

It's not OK to call `realpath` in the compiler.

Reopens #12419
2023-01-02 16:31:45 -07:00
Ryan Liptak
0cbc59f227 standalone tests: Add windows spawn test
Tests a decent amount of edge cases dealing with how PATH and PATHEXT searching is handled.
2022-12-18 03:55:28 -08:00
Coin
5e111098e5 Revert "compiler_c test: skip build modes on aarch64-windows"
This reverts commit c029a98f1c601f4ff1369b49a4402d5c94fbb168.
2022-12-12 04:58:10 +08:00
Coin
ed0ecd9bff Revert "mix_c_files: skip build modes on aarch64-windows due to bug"
This reverts commit cf543199cad033b9739ce1b623d95fd30c973791.
2022-12-12 04:57:55 +08:00
Jakub Konka
c029a98f1c compiler_c test: skip build modes on aarch64-windows 2022-12-10 16:00:59 -07:00
Jakub Konka
cf543199ca mix_c_files: skip build modes on aarch64-windows due to bug 2022-12-10 16:00:59 -07:00
Andrew Kelley
b1793c2b52 add test coverage for zig build CLI and options API 2022-11-30 13:22:43 -07:00
Jakub Konka
033aa1d761 aarch64-windows: skip failing standalone tests 2022-11-28 19:45:53 -05:00
Veikka Tuominen
8082323dfd
Merge pull request #13411 from dweiller/custom-test-runner
Custom test runner
2022-11-18 14:47:21 +02:00
Andrew Kelley
a50ad04e85 disable failing test on aarch64-macos 2022-11-14 16:07:52 -07:00
dweiller
ae0f12885b test: add test_runner_path test 2022-11-02 22:41:20 +11:00
Hadrien Dorio
9db293492b make a .rsp file for zig clang
same as std.build.LibExeObjStep.make() for `zig build-exe`
closes #12419
2022-10-26 23:50:51 +02:00
Veikka Tuominen
8fa91939a8 build.zig: separate C ABI tests from standalone tests 2022-10-22 11:31:41 +03:00
Jacob Young
c7f9833238 Module: fix early exit conditions during compilation
* `--verbose-llvm-ir` should trigger analysis and codegen
 * `-femit-asm` etc should trigger codegen even with `-fno-emit-bin`

Closes #12588
2022-10-15 14:18:35 -04:00
Evan Haas
e4e1c21e1f i386 ABI: Fix some sizes and alignments
This makes the following changes for i386:

long long and unsigned long long have 4 byte alignment on non-Windows

f64 (double) has 4-byte alignment on non-Windows

long double is 80 bits and has 4 byte alignment on mingw

long double on android is 64 bits, not 80: https://www.uclibc.org/docs/psABI-i386.pdf

Fixes #12453
Fixes #12987
2022-10-14 15:22:00 -04:00
Jacob Young
9b45dc1608 stage2: fix emitting asm and bin at the same time
This logic is copied from stage1.

Fixes #12800
2022-10-14 14:46:50 -04:00
Jacob Young
8b66443d50 llvm: avoid undefined values by ensuring the StackTrace decl is analyzed
The test builds an object file to prevent StackTrace from already having
been analyzed by other code.

Fixes #13030
2022-10-01 04:02:09 -04:00
Andrew Kelley
b7900de168 Merge remote-tracking branch 'origin/master' into llvm15 2022-09-06 19:45:02 -07:00
Veikka Tuominen
9ce841a0f0 stage2 llvm: implement aarch64 C ABI
... at least enough to pass all the current tests.
2022-09-04 18:46:56 +03:00
Veikka Tuominen
db54cd247d Sema: do not emit dbg_inline_end after NoReturn
Closes #12698
2022-09-02 17:57:10 +03:00
Veikka Tuominen
2cd3989cb3 Sema: add more validation to coerceVarArgParam
Closes #12706
2022-09-01 13:16:33 +03:00
Andrew Kelley
fb81ba8762 LLVM: fix extern functions missing attributes
Extern functions were missing attributes such as "readonly" on
non-optional pointers, and "byval" which is required to match C ABI.

Follow-up from bf28765a975355c27558eaa86cf00ccb29b663a7.

closes #12683
2022-08-30 14:45:03 -07:00
Evan Haas
bcaa9df5b4 translate-c: Don't add self-defined macros to global name table
A self-defined macro is one of the form `#define FOO FOO`

Those types of macros have never been translated; this change will cause
any macros which refer to them to be translated as `@compileError` instead
of referring to a non-existent identifier.

Closes #12471
2022-08-26 11:24:57 +03:00
Andrew Kelley
23a227a073 disable failing standalone test: issue_11595
See tracking issue #12419
2022-08-11 17:53:12 -07:00
Veikka Tuominen
74673b7f69 stage2 llvm: implement more C ABI 2022-08-10 20:52:36 -04:00
Veikka Tuominen
3818d63dd8 Sema: resolve pointee type in zirReify
Closes #12223
2022-07-27 17:11:46 +03:00
Andrew Kelley
e2d4709779 C ABI tests no longer apply to only stage1 2022-07-26 14:51:45 -07:00
Luuk de Gram
9a3dacc00e
Merge pull request #12188 from Luukdegram/llvm-wasm-c-abi
stage2: llvm - Implement C ABI when targetting wasm32
2022-07-25 16:12:36 +02:00
Luuk de Gram
a7417f7839
wasm: Enable C-ABI tests for self-hosted compiler 2022-07-25 06:34:00 +02:00
Andrew Kelley
be294e3744 CI stage3 test coverage for test-standalone 2022-07-24 15:02:05 -07:00
Andrew Kelley
3114978389 update standalone test cases for stage2 2022-07-21 22:51:17 -07:00
Andrew Kelley
c061b3a572 disable more standalone tests
these are tripping LLVM 13 assertions.

See #12015
See #12022
2022-07-06 15:10:41 -07:00
Andrew Kelley
aab1284e10 disable failing standalone test - tools/gen_spirv_spec.zig
Because it is tripping an LLVM 13 assertion.

See #12015
2022-07-06 02:39:28 -07:00
Jakub Konka
38edef35bf test: introduce link(er) tests - builds on standalone tests 2022-06-20 17:59:17 +02:00