about summary refs log tree commit diff
path: root/src/tools/compiletest
AgeCommit message (Collapse)AuthorLines
2020-11-02Auto merge of #78667 - pietroalbini:lldb-unbuffered, r=Mark-Simulacrumbors-0/+1
Try running lldb_batchmode.py with PYTHONUNBUFFERED When reporting fatal errors, LLVM calls abort() to exit the program. There is a chance that might interfere with Python printing stuff to stdout, as by default it relies on buffering to increase performance. This commit tries to disable Python buffering, to hopefully get useful logs while debugging #78665.
2020-11-02compiletest: try running lldb_batchmode.py with PYTHONUNBUFFEREDPietro Albini-0/+1
When reporting fatal errors, LLVM calls abort() to exit the program. There is a chance that might interfere with Python printing stuff to stdout, as by default it relies on buffering to increase performance. This commit tries to disable Python buffering, to hopefully get useful logs while debugging #78665.
2020-10-30Always pass `-Z future-incompat-report` to UI testsAaron Hill-0/+1
2020-10-30Don't display empty future-compat reportAaron Hill-16/+21
2020-10-30Update into-iter-on-arrays test to check future-incompat-reportAaron Hill-11/+22
2020-10-30Only error on unfixed diagnosticsAaron Hill-1/+3
2020-10-30Strip out non-diagnostic lines from rustfix inputAaron Hill-7/+20
2020-10-30Print future breakage reportAaron Hill-6/+9
2020-10-30Some workAaron Hill-2/+17
2020-10-29Add support for rustc-env and unset-rustc-env for aux-buildsTomasz Miąsko-0/+5
2020-10-20Initialize tracing subscriber in compiletest toolTomasz Miąsko-2/+2
The logging in compiletest was migrated from log crate to a tracing, but the initialization code was never changed, so logging is non-functional. Initialize tracing subscriber using default settings.
2020-10-05Updates to experimental coverage counter injectionRich Kadel-2/+12
This is a combination of 18 commits. Commit #2: Additional examples and some small improvements. Commit #3: fixed mir-opt non-mir extensions and spanview title elements Corrected a fairly recent assumption in runtest.rs that all MIR dump files end in .mir. (It was appending .mir to the graphviz .dot and spanview .html file names when generating blessed output files. That also left outdated files in the baseline alongside the files with the incorrect names, which I've now removed.) Updated spanview HTML title elements to match their content, replacing a hardcoded and incorrect name that was left in accidentally when originally submitted. Commit #4: added more test examples also improved Makefiles with support for non-zero exit status and to force validation of tests unless a specific test overrides it with a specific comment. Commit #5: Fixed rare issues after testing on real-world crate Commit #6: Addressed PR feedback, and removed temporary -Zexperimental-coverage -Zinstrument-coverage once again supports the latest capabilities of LLVM instrprof coverage instrumentation. Also fixed a bug in spanview. Commit #7: Fix closure handling, add tests for closures and inner items And cleaned up other tests for consistency, and to make it more clear where spans start/end by breaking up lines. Commit #8: renamed "typical" test results "expected" Now that the `llvm-cov show` tests are improved to normally expect matching actuals, and to allow individual tests to override that expectation. Commit #9: test coverage of inline generic struct function Commit #10: Addressed review feedback * Removed unnecessary Unreachable filter. * Replaced a match wildcard with remining variants. * Added more comments to help clarify the role of successors() in the CFG traversal Commit #11: refactoring based on feedback * refactored `fn coverage_spans()`. * changed the way I expand an empty coverage span to improve performance * fixed a typo that I had accidently left in, in visit.rs Commit #12: Optimized use of SourceMap and SourceFile Commit #13: Fixed a regression, and synched with upstream Some generated test file names changed due to some new change upstream. Commit #14: Stripping out crate disambiguators from demangled names These can vary depending on the test platform. Commit #15: Ignore llvm-cov show diff on test with generics, expand IO error message Tests with generics produce llvm-cov show results with demangled names that can include an unstable "crate disambiguator" (hex value). The value changes when run in the Rust CI Windows environment. I added a sed filter to strip them out (in a prior commit), but sed also appears to fail in the same environment. Until I can figure out a workaround, I'm just going to ignore this specific test result. I added a FIXME to follow up later, but it's not that critical. I also saw an error with Windows GNU, but the IO error did not specify a path for the directory or file that triggered the error. I updated the error messages to provide more info for next, time but also noticed some other tests with similar steps did not fail. Looks spurious. Commit #16: Modify rust-demangler to strip disambiguators by default Commit #17: Remove std::process::exit from coverage tests Due to Issue #77553, programs that call std::process::exit() do not generate coverage results on Windows MSVC. Commit #18: fix: test file paths exceeding Windows max path len
2020-09-29Ensure that all LLVM components requested by tests are available on CIVadim Petrochenkov-2/+5
2020-09-18Fix --bless for mir-opt 32/64 bit fileNixon Enraght-Moony-3/+4
2020-09-17Put bit qualifier before mir/diffNixon Enraght-Moony-2/+2
2020-09-05compiletest: Introduce "min-cdb-version"MaulingMonkey-6/+51
2020-08-27Adds --bless support to test/run-make-fulldepsRich Kadel-0/+12
The ability to "bless" output for some of these tests is critical to making it practical to adapt tests to unrelated changes. This is needed for new coverage tests, as shown in PR #75828 (or its derivative).
2020-08-22compiletest: fix a couple clippy lint findingsMatthias Krüger-72/+59
2020-08-18Validate the MIR of all optimizations in the mir-opt directoryOliver Scherer-0/+1
2020-08-15replaced log with tracingGurpreet Singh-6/+6
2020-08-09Add sanitizer support on FreeBSDGreg V-3/+8
2020-08-07Auto merge of #74821 - oli-obk:const_eval_read_uninit_fast_path, r=wesleywiserbors-2/+13
Check whether locals are too large instead of whether accesses into them are too large Essentially this stops const prop from attempting to optimize ```rust let mut x = [0_u8; 5000]; x[42] = 3; ``` I don't expect this to be a perf improvement without #73656 (which is also where the lack of this PR will be a perf regression). r? @wesleywiser
2020-08-07Auto merge of #73842 - euclio:doctest-expn, r=GuillaumeGomezbors-2/+4
Use outermost invocation span for doctest names Fixes #70090. This PR also allows using aux-build files in rustdoc-ui tests.
2020-08-07Rollup merge of #74888 - infinity0:ignore-endian-big, r=nikomatsakisYuki Okushi-0/+21
compiletest: ignore-endian-big, fixes #74829, fixes #74885 See discussion on #74829 I tested it on a Debian s390x machine, works well.
2020-08-02Rollup merge of #75064 - petrochenkov:llvmtarg, r=Mark-SimulacrumManish Goregaokar-0/+12
compiletest: Support ignoring tests requiring missing LLVM components This PR implements a more principled solution to the problem described in https://github.com/rust-lang/rust/pull/66084. Builds of LLVM backends take a lot of time and disk space. So it usually makes sense to build rustc with ```toml [llvm] targets = "X86" experimental-targets = "" ``` unless you are working on some target-specific tasks. A few tests, however, require non-x86 backends to be built. A new test directive `// needs-llvm-components: component1 component2 component3` makes such tests to be automatically ignored if one of the listed components is missing in the provided LLVM (this is determined through `llvm-config --components`). As a result, the test suite now fully passes with LLVM built only with the x86 backend. The component list in this case is ``` aggressiveinstcombine all all-targets analysis asmparser asmprinter binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mirparser native nativecodegen objcarcopts object objectyaml option orcerror orcjit passes profiledata remarks runtimedyld scalaropts selectiondag support symbolize tablegen target textapi transformutils vectorize windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray ``` (With the default target list it's much larger.) ``` aarch64 aarch64asmparser aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils aggressiveinstcombine all all-targets analysis arm armasmparser armcodegen armdesc armdisassembler arminfo armutils asmparser asmprinter avr avrasmparser avrcodegen avrdesc avrdisassembler avrinfo binaryformat bitreader bitstreamreader bitwriter cfguard codegen core coroutines coverage debuginfocodeview debuginfodwarf debuginfogsym debuginfomsf debuginfopdb demangle dlltooldriver dwarflinker engine executionengine frontendopenmp fuzzmutate globalisel hexagon hexagonasmparser hexagoncodegen hexagondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader jitlink libdriver lineeditor linker lto mc mca mcdisassembler mcjit mcparser mips mipsasmparser mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmparser msp430codegen msp430desc msp430disassembler msp430info native nativecodegen nvptx nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcerror orcjit passes powerpc powerpcasmparser powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata remarks riscv riscvasmparser riscvcodegen riscvdesc riscvdisassembler riscvinfo riscvutils runtimedyld scalaropts selectiondag sparc sparcasmparser sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target textapi transformutils vectorize webassembly webassemblyasmparser webassemblycodegen webassemblydesc webassemblydisassembler webassemblyinfo windowsmanifest x86 x86asmparser x86codegen x86desc x86disassembler x86info x86utils xray ``` https://github.com/rust-lang/rust/pull/66084 is also reverted now. r? @Mark-Simulacrum
2020-08-02compiletest: Support ignoring tests requiring missing LLVM componentsVadim Petrochenkov-0/+12
2020-08-02compiletest: print diff for pretty testsDavid Wood-9/+16
This commit modifies compiletest so that a diff of actual and expected output is shown for pretty tests. This makes it far easier to work out what has changed. Signed-off-by: David Wood <david@davidtw.co>
2020-07-31Move from `log` to `tracing`Oliver Scherer-1/+1
2020-07-31compiletest: ignore-endian-big, fixes #74829, fixes #74885Ximin Luo-0/+21
2020-07-29Improve the diagnostics around misspelled mir dump filenamesOliver Scherer-2/+13
2020-07-29Move mir-opt tests to toplevelXavier Denis-29/+48
2020-07-27mv std libs to library/mark-2/+11
2020-07-25Clean up some uses of logging in ui testsOliver Scherer-1/+1
2020-07-24Rollup merge of #74715 - oli-obk:mir_pass_diff, r=wesleywiserManish Goregaokar-10/+43
Add a system for creating diffs across multiple mir optimizations. r? @wesleywiser
2020-07-24Add a system for creating diffs across multiple mir optimizations.Oliver Scherer-10/+43
2020-07-22Rollup merge of #74237 - lzutao:compiletest, r=Mark-SimulacrumManish Goregaokar-245/+200
compiletest: Rewrite extract_*_version functions This makes extract_lldb_version has the same version type like extract_gdb_version.
2020-07-19Rewrite extract_version_rangeLzu Tao-23/+46
2020-07-19Rewrite extract_llvm_versionLzu Tao-57/+49
2020-07-19Extract extract_version_rangeLzu Tao-32/+34
2020-07-19Add missing : after *llvm-versionLzu Tao-4/+4
2020-07-19Use subslice patternLzu Tao-6/+6
2020-07-19Extract closure to functionLzu Tao-4/+8
2020-07-19Use Option::as_derefLzu Tao-5/+3
2020-07-19Fix panic as passing wrong format to `extract_gdb_version`Lzu Tao-11/+8
2020-07-19compiletest: Rewrite extract_gdb_version functionLzu Tao-63/+28
2020-07-19compiletest: Rewrite extract_lldb_version functionLzu Tao-76/+50
This makes extract_lldb_version has the same version type like extract_gdb_version. This is technically a breaking change for rustc-dev users. But note that rustc-dev is a nightly component.
2020-07-19Auto merge of #74091 - richkadel:llvm-coverage-map-gen-4, r=tmandrybors-0/+12
Generating the coverage map @tmandry @wesleywiser rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example commands to generate a coverage report: ```shell $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main ``` ![rust coverage report only 20200706](https://user-images.githubusercontent.com/3827298/86697299-1cbe8f80-bfc3-11ea-8955-451b48626991.png) r? @wesleywiser Rust compiler MCP rust-lang/compiler-team#278 Relevant issue: #34701 - Implement support for LLVMs code coverage instrumentation
2020-07-17Generating the coverage mapRich Kadel-0/+12
rustc now generates the coverage map and can support (limited) coverage report generation, at the function level. Example: $ BUILD=$HOME/rust/build/x86_64-unknown-linux-gnu $ $BUILD/stage1/bin/rustc -Zinstrument-coverage \ $HOME/rust/src/test/run-make-fulldeps/instrument-coverage/main.rs $ LLVM_PROFILE_FILE="main.profraw" ./main called $ $BUILD/llvm/bin/llvm-profdata merge -sparse main.profraw -o main.profdata $ $BUILD/llvm/bin/llvm-cov show --instr-profile=main.profdata main 1| 1|pub fn will_be_called() { 2| 1| println!("called"); 3| 1|} 4| | 5| 0|pub fn will_not_be_called() { 6| 0| println!("should not have been called"); 7| 0|} 8| | 9| 1|fn main() { 10| 1| let less = 1; 11| 1| let more = 100; 12| 1| 13| 1| if less < more { 14| 1| will_be_called(); 15| 1| } else { 16| 1| will_not_be_called(); 17| 1| } 18| 1|}
2020-07-17Allow matching test by target and envMateusz Mikuła-0/+1
2020-07-08Avoid "blacklist"Tamir Duberstein-5/+1
Other terms are more inclusive and precise. Clippy still has a lint named "blacklisted-name", but renaming it would be a breaking change, so is left for future work. The target configuration option "abi-blacklist" has been depreciated and renamed to "unsupported-abis". The old name continues to work.