about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2024-03-04Auto merge of #120468 - alexcrichton:start-wasm32-wasi-rename, r=wesleywiserbors-0/+10
Add a new `wasm32-wasip1` target to rustc This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-03Auto merge of #121877 - estebank:fancy-svg, r=compiler-errorsbors-3/+25
On tests that specify `--color=always` emit SVG file with stderr output Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly. <img src="https://raw.githubusercontent.com/rust-lang/rust/b4bdb56f86e136ca63bf71dca3034200c6c25900/tests/ui/error-emitter/highlighting.svg">
2024-03-02On tests that specify --color=always emit SVG file with stderr outputEsteban Kuber-3/+25
Leverage `anstyle-svg`, as `cargo` does now, to emit `.svg` files instead of `.stderr` files for tests that explicitly enable color output. This will make reviewing changes to the graphical output of tests much more human friendly.
2024-03-02Add a new `wasm32-wasip1` target to rustcAlex Crichton-0/+10
This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs: * https://github.com/rust-lang/compiler-team/issues/607 * https://github.com/rust-lang/compiler-team/issues/695 In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](https://github.com/rust-lang/rust/pull/119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
2024-03-01Add initial support for DataFlowSanitizerRamon de C Valle-0/+8
Adds initial support for DataFlowSanitizer to the Rust compiler. It currently supports `-Zsanitizer-dataflow-abilist`. Additional options for it can be passed to LLVM command line argument processor via LLVM arguments using `llvm-args` codegen option (e.g., `-Cllvm-args=-dfsan-combine-pointer-labels-on-load=false`).
2024-02-29Add supporting infrastructure for `run-make` V2 tests许杰友 Jieyou Xu (Joe)-9/+269
2024-02-26Rollup merge of #120656 - Zalathar:filecheck-flags, r=wesleywiserGuillaume Gomez-16/+31
Allow tests to specify a `//@ filecheck-flags:` header This allows individual codegen/assembly/mir-opt tests to pass extra flags to the LLVM `filecheck` tool as needed. --- The original motivation was noticing that `tests/run-make/instrument-coverage` was very close to being an ordinary codegen test, except that it needs some extra logic to set up platform-specific variables to be passed into filecheck. I then saw the comment in `verify_with_filecheck` indicating that a `filecheck-flags` header might be useful for other purposes as well.
2024-02-23Ignore less tests in debug buildsBen Kimock-2/+5
2024-02-23Allow tests to specify a `//@ filecheck-flags:` headerZalathar-5/+14
Any flags specified here will be passed to LLVM's `filecheck` tool, in tests that use that tool.
2024-02-23Simplify existing code for setting `filecheck` flagsZalathar-11/+17
This removes a version check for LLVM >=13, and specifies prefixes as a series of independent `--check-prefix` flags instead of a single `--check-prefixes`.
2024-02-22Update compiletest to only accept `//@` directives许杰友 Jieyou Xu (Joe)-30/+13
2024-02-22Update list of known directive names for diagnostics许杰友 Jieyou Xu (Joe)-0/+52
2024-02-21Rollup merge of #121373 - Zalathar:test-revision, r=oli-obkMatthias Krüger-65/+81
Consistently refer to a test's `revision` instead of `cfg` Compiletest allows a test file to specify multiple “revisions” (`//@ revisions: foo bar`), with each revision running as a separate test, and having the ability to define revision-specific headers (`//`@[foo]` ignore-blah`) and revision-specific code (`#[cfg(foo)]`). The code that implements this feature sometimes uses the term “cfg” instead of “revision”. This results in two confusingly-different names for the same concept, one of which is ambiguous with other kinds of configuration (such as compiletest's own config). This PR replaces those occurrences of `cfg` with `revision`, so that one name is used consistently.
2024-02-21Rollup merge of #121347 - davidtwco:compiletest-aux-aux, r=oli-obkLeón Orell Valerian Liehr-23/+23
compiletest: support auxiliaries with auxiliaries To test behaviour that depends on the extern options of intermediate crates, compiletest auxiliaries must have their own auxiliaries. Auxiliary compilation previously did not trigger compilation of any auxiliaries in the auxiliary's headers. In addition, those auxiliaries would need to be in an `auxiliary/auxiliary` directory, which is unnecessary and makes some crate graphs harder to write tests for, such as when A depends on B and C, and B depends on C. For a test `tests/ui/$path/root.rs`, with the following crate graph: ``` root |-- grandparent `-- parent `-- grandparent ``` then the intermediate outputs from compiletest will be: ``` build/$target/test/ui/$path/ |-- auxiliary | |-- libgrandparent.dylib | |-- libparent.dylib | |-- grandparent | | |-- grandparent.err | | `-- grandparent.out | `-- parent | |-- parent.err | `-- parent.out |-- libroot.rmeta |-- root.err `-- root.out ```
2024-02-21compiletest: support auxiliaries with auxiliariesDavid Wood-23/+23
To test behaviour that depends on the extern options of intermediate crates, compiletest auxiliaries must have their own auxiliaries. Auxiliary compilation previously did not trigger compilation of any auxiliaries in the auxiliary's headers. In addition, those auxiliaries would need to be in an `auxiliary/auxiliary` directory, which is unnecessary and makes some crate graphs harder to write tests for, such as when A depends on B and C, and B depends on C. For a test `tests/ui/$path/root.rs`, with the following crate graph: ``` root |-- grandparent `-- parent `-- grandparent ``` then the intermediate outputs from compiletest will be: ``` build/$target/test/ui/$path/ |-- auxiliary | |-- libgrandparent.dylib | |-- libparent.dylib | |-- grandparent | | |-- grandparent.err | | `-- grandparent.out | `-- parent | |-- parent.err | `-- parent.out |-- libroot.rmeta |-- root.err `-- root.out ``` Signed-off-by: David Wood <david@davidtw.co>
2024-02-21Flatten the parse logic in `line_directive`Zalathar-18/+13
2024-02-21Consistently refer to a test's `revision` instead of `cfg`Zalathar-41/+44
Compiletest code sometimes refers to a test's revision as its `cfg`. This results in two different names for the same thing, one of which is ambiguous with other kinds of configuration (such as compiletest's own config). This patch replaces those occurrences of `cfg` with `revision`.
2024-02-21Improve internal docs for the `HeaderLine` callback structZalathar-8/+26
2024-02-20Update panic message for missing `//@ run-rustfix` ui test suite when a ↵许杰友 Jieyou Xu (Joe)-4/+9
.fixed file exists
2024-02-20Rollup merge of #121233 - Zalathar:extra-directives, r=oli-obkNilstrieb-49/+43
Move the extra directives for `Mode::CoverageRun` into `iter_header` When these extra directives were ported over as part of #112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that #120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
2024-02-18Auto merge of #121265 - klensy:bump-18-02-24, r=Mark-Simulacrumbors-1/+1
bump some deps First commit dedupes darling* crates and remove one more syn 1.* dep Second one bumps windows crate to 0.52
2024-02-18windows bump to 0.52klensy-1/+1
2024-02-18Move the extra directives for `Mode::CoverageRun` into `iter_header`Zalathar-39/+21
When these extra directives were ported over as part of #112300, it made sense to introduce `iter_header_extra` and pass them in as an extra argument. But now that #120881 has added a `mode` parameter to `iter_header` for its own purposes, it's slightly simpler to move the coverage special-case code directly into `iter_header` as well. This lets us get rid of `iter_header_extra`.
2024-02-18Wrap `iter_header` callback arguments in a documentable structZalathar-12/+24
2024-02-17compiletest: fix regex rebuildsklensy-2/+4
2024-02-16Implement infra support for migrating from `//` to `//@` ui test directives许杰友 Jieyou Xu (Joe)-300/+557
2024-02-12Rollup merge of #120273 - klensy:ct-run, r=onur-ozkanMatthias Krüger-11/+16
compiletest: few naive improvements Tested on `python x.py --stage=1 t tests/ui/borrowck/ --force-rerun`, see individual commits. Wall time didn't improved :-) .
2024-02-06Tweak a few mir-opt tests instead of using -Clink-dead-codeBen Kimock-1/+0
2024-02-06Use a better set of targets for blessing mir-opt testsBen Kimock-0/+2
2024-01-24add fixme about walking tests treeklensy-0/+2
2024-01-23don't collect found paths into BTreeSet:klensy-5/+6
keeping order of inserted Paths having high cost on hot path, collect into HashSet instead and sort afterward. from 1,858,963,938 to 1,448,975,825 I refs.
2024-01-23Remove support for no-system-llvmNikita Popov-12/+12
Also add tests for min-system-llvm-version.
2024-01-23reduce bufreader size from default(8kb) to 1kbklensy-1/+1
Headers WAY less than 1kb anyway, so this can be improved more? before ==18725== Total: 429,769,246 bytes in 957,259 blocks ==18725== At t-gmax: 8,058,316 bytes in 3,502 blocks ==18725== At t-end: 3,045,261 bytes in 1,097 blocks ==18725== Reads: 431,872,599 bytes ==18725== Writes: 214,738,653 bytes after ==49344== Total: 201,418,575 bytes in 957,174 blocks ==49344== At t-gmax: 7,937,250 bytes in 3,310 blocks ==49344== At t-end: 3,035,637 bytes in 1,076 blocks ==49344== Reads: 431,607,448 bytes ==49344== Writes: 210,731,540 bytes
2024-01-23compiletest: reduce useless regex rebuildsklensy-5/+7
before: ==8812== Total: 2,374,977,159 bytes in 6,840,026 blocks ==8812== At t-gmax: 8,090,486 bytes in 3,389 blocks ==8812== At t-end: 3,185,454 bytes in 757 blocks ==8812== Reads: 1,873,472,286 bytes ==8812== Writes: 1,249,411,589 bytes ==11212== I refs: 6,370,244,180 after: ==18725== Total: 429,769,246 bytes in 957,259 blocks ==18725== At t-gmax: 8,058,316 bytes in 3,502 blocks ==18725== At t-end: 3,045,261 bytes in 1,097 blocks ==18725== Reads: 431,872,599 bytes ==18725== Writes: 214,738,653 bytes ==20839== I refs: 1,873,010,089
2024-01-18Warn when no profiler runtime means coverage tests won't be run/blessedZalathar-0/+9
2024-01-09Rollup merge of #119619 - onur-ozkan:panic-abort-mir-opt, r=oli-obkMatthias Krüger-12/+33
mir-opt and custom target fixes From https://github.com/rust-lang/rust/issues/115642#issuecomment-1879589022 > > Could you please test the last two commits from https://github.com/onur-ozkan/rust/commits/panic-abort-mir-opt when you have the time? The first commit should resolve the error of using the nightly flag with a stable compiler, and the second one should resolve the custom target issue. > I tested with the two commits and the errors of using nightly flag and custom target specs were not seen. Testing was completed for the test suites like ui, run-pass-valgrind, coverage, mir-opt, codegen, assembly, incremental. Fixes #115642
2024-01-08detect user-specified custom targets in compiletestonur-ozkan-12/+33
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-01-07coverage: Anonymize line numbers in branch viewsZalathar-3/+93
The code for anonymizing line numbers in coverage reports now supports the slightly different line number syntax used by branch regions.
2024-01-05Allow coverage tests to enable `llvm-cov --use-color`Zalathar-0/+11
2024-01-05Extract a `split_flags` helper in header directive parsingZalathar-9/+16
2024-01-05Allow tests to ignore individual test modesZalathar-3/+36
Normally, each test in `tests/coverage` is automatically run in both `coverage-map` mode and `coverage-run` mode. This new family of directives allows an individual test to specify that it should not be run in a particular mode.
2024-01-05Check for profiler support via a flag, instead of an environment varZalathar-1/+26
2024-01-04Rollup merge of #119184 - Rajveer100:branch-for-issue-118752, r=davidtwcoMatthias Krüger-11/+17
Switch from using `//~ERROR` annotations with `--error-format` to `error-pattern` Fixes #118752 As noticed by ```@jyn514``` while working on a patch, tests failed due to `//~ERROR` annotations used in combination with the older `--error-format` which is now `error-pattern`.
2023-12-21Switch from using `//~ERROR` annotations with `--error-format` to ↵Rajveer-11/+17
`error-pattern` Resolves Issue #118752
2023-12-21Enable -Zlint-mir by default for mir-opt testsTomasz Miąsko-0/+1
2023-12-14update use of feature flagslcnr-2/+2
2023-12-07also print 'immutable' flagRalf Jung-2/+5
2023-11-30Auto merge of #118036 - DianQK:thinlto-tests, r=tmiaskobors-15/+55
Add thinlto support to codegen, assembly and coverage tests Using `--emit=llvm-ir` with thinlto usually result in multiple IR files. Resolve test case failure issue reported in #113923.
2023-11-30Add thinlto support to codegen, assembly and coverage testsDianQK-15/+55
2023-11-29Auto merge of #118132 - onur-ozkan:stdlib-assertion-status-to-compiletest, ↵bors-2/+8
r=wesleywiser utilize stdlib debug assertion status in compiletest Implemented a new flag `--with-debug-assertions` on compiletest to pass the stdlib debug assertion status from bootstrap. Resolves #115171