about summary refs log tree commit diff
path: root/src/test/codegen
AgeCommit message (Collapse)AuthorLines
2020-06-25Prepare for LLVM 11Josh Stone-3/+3
2020-06-24Split out async fn and generator testTyler Mandry-72/+102
This keeps FileCheck from tripping over unimportant differences in codegen.
2020-06-24Give up on checking filenameTyler Mandry-8/+4
2020-06-24Add generator-debug test for MSVCTyler Mandry-0/+88
..which doesn't use variant types.
2020-06-24Generalize generator-debug test a bitTyler Mandry-21/+19
Don't be so reliant on particular line ordering (though FileCheck makes this hard in general, IMO). Also disable for MSVC.
2020-06-24Add test for generator debuginfoTyler Mandry-0/+94
2020-06-20Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearthbors-0/+53
Rollup of 9 pull requests Successful merges: - #72456 (Try to suggest dereferences on trait selection failed) - #72788 (Projection bound validation) - #72790 (core/time: Add Duration methods for zero) - #73227 (Allow multiple `asm!` options groups and report an error on duplicate options) - #73287 (lint: normalize projections using opaque types) - #73291 (Pre-compute `LocalDefId` <-> `HirId` mappings and remove `NodeId` <-> `HirId` conversion APIs) - #73378 (Remove use of specialization from librustc_arena) - #73411 (Update bootstrap to rustc 1.45.0-beta.2 (1dc0f6d8e 2020-06-15)) - #73443 (ci: allow gating GHA on everything but macOS) Failed merges: r? @ghost
2020-06-20Add codegen test for multiple `asm!` optionsCamelid-0/+53
2020-06-20Rollup merge of #73404 - ajpaverd:cfguard_syntax, r=Mark-SimulacrumRalf Jung-3/+3
Update CFGuard syntax Update the naming and syntax of the control-flow-guard option, as discussed in #68793. r? @Mark-Simulacrum
2020-06-19Rollup merge of #73054 - RalfJung:dont-panic, r=Mark-SimulacrumRalf Jung-2/+0
memory access sanity checks: abort instead of panic Suggested by @Mark-Simulacrum, this should help reduce the performance impact of these checks.
2020-06-19Rollup merge of #73044 - tmiasko:compiletest-san, r=nikomatsakisRalf Jung-11/+6
compiletest: Add directives to detect sanitizer support Add needs-sanitizer-{address,leak,memory,thread} directive indicating that test requires target with support for specific sanitizer. This is an addition to the existing needs-sanitizer-support directive indicating that test requires a sanitizer runtime library. The existing needs-sanitizer-support directive could be incorporated into the new ones, but I decided to retain it, since it enables running sanitizer codegen tests even when building of sanitizer runtime libraries is disabled.
2020-06-19Rollup merge of #73362 - erikdesjardins:bounds, r=nikomatsakisRalf Jung-0/+44
Test that bounds checks are elided when slice len is checked up-front Closes #69101
2020-06-17ignore-debug: debug assertions in slice indexing prevent the optimizationerikdesjardins-0/+1
2020-06-16we can enable one more codegen test in debug mode nowRalf Jung-2/+0
2020-06-16Update CFGuard syntaxAndrew Paverd-3/+3
2020-06-15elaborate, add check for exact boundsErik Desjardins-1/+18
2020-06-15Update sanitizer testNathan Corbyn-1/+2
2020-06-15Fix sanitizer testNathan Corbyn-2/+1
2020-06-15Fix whitespaceNathan Corbyn-1/+1
2020-06-15Fix exports with `#[inline(always)]`Nathan Corbyn-8/+63
2020-06-15Fix whitespaceNathan Corbyn-1/+1
2020-06-15Export all fns with extern indicatorNathan Corbyn-26/+61
2020-06-15Export `#[inline] #[no_mangle]` fns in cdylibs and staticlibsNathan Corbyn-0/+26
2020-06-15Test that bounds checks are elided when slice len is checked up-frontErik Desjardins-0/+26
2020-06-13compiletest: Add directives to detect sanitizer supportTomasz Miąsko-11/+6
Add needs-sanitizer-{address,leak,memory,thread} directive indicating that test requires target with support for specific sanitizer. This is an addition to the existing needs-sanitizer-support directive indicating that test requires a sanitizer runtime library.
2020-06-07Rollup merge of #72977 - tblah:riscv-codegen-llvm10, r=nikomatsakisDylan DPC-41/+93
Fix codegen tests for RISC-V Some codegen tests didn't seem relevant (e.g. unsupported annotations). The RISC-V abi tests were broken by LLVM 10, c872dcf fixes that (cc: @msizanoen1) I'm not sure about skipping catch-unwind.rs and included that change here mostly as a request for comment - I can't tell if that's a bug.
2020-06-04Revert "Defer creating drop trees in MIR lowering until leaving that scope"Felix S. Klock II-3/+3
This reverts commit 611988551fba1bcbb33ae2e1e0171cb8d2e70d5a.
2020-06-04test: codegen: skip catch-unwind on riscv64Tom Eccles-0/+9
It isn't clear to me if this is a bug or not, hence the FIXME
2020-06-04test: codegen: Add riscv abi llvm intrinsics testTom Eccles-0/+32
2020-06-04test: codegen: riscv64-abi: print value numbers for unnamed func argsTom Eccles-41/+41
LLVM 10 includes a009a60a917bc30940422bcef73f8270566d78db which will print value numbers for unnamed func args. Update these tests to be in line with the referenced clang tests.
2020-06-04test: codegen: skip tests inappropriate for riscv64Tom Eccles-0/+11
2020-05-27Omit DW_AT_linkage_name when it is the same as DW_AT_nameTomasz Miąsko-0/+42
The DWARF standard suggests that it might be useful to include `DW_AT_linkage_name` when it is *distinct* from the identifier name.
2020-05-24Added a codegen test for a recent optimization for overflow-checks=onAlex Gaynor-0/+26
Closes #58692
2020-05-21Auto merge of #71718 - NeoRaider:ffi_const_pure, r=Amanieubors-0/+24
Experimentally add `ffi_const` and `ffi_pure` extern fn attributes Add FFI function attributes corresponding to clang/gcc/... `const` and `pure`. Rebased version of #58327 by @gnzlbg with the following changes: - Switched back from the `c_ffi_const` and `c_ffi_pure` naming to `ffi_const` and `ffi_pure`, as I agree with https://github.com/rust-lang/rust/pull/58327#issuecomment-462718772 and this nicely aligns with `ffi_returns_twice` - (Hopefully) took care of all of @hanna-kruppe's change requests in the original PR r? @hanna-kruppe
2020-05-21Auto merge of #72205 - ecstatic-morse:nrvo, r=oli-obkbors-2/+19
Dumb NRVO This is a very simple version of an NRVO pass, which scans backwards from the `return` terminator to see if there is an an assignment like `_0 = _1`. If a basic block with two or more predecessors is encountered during this scan without first seeing an assignment to the return place, we bail out. This avoids running a full "reaching definitions" dataflow analysis. I wanted to see how much `rustc` would benefit from even a very limited version of this optimization. We should be able to use this as a point of comparison for more advanced versions that are based on live ranges. r? @ghost
2020-05-20Rollup merge of #72139 - nnethercote:standalone-fold, r=cuviperDylan DPC-24/+0
Make `fold` standalone. `fold` is currently implemented via `try_fold`, but implementing it directly results in slightly less LLVM IR being generated, speeding up compilation of some benchmarks. r? @cuviper
2020-05-20Add tests for `#[ffi_const]` and `#[ffi_pure]` function attributesMatthias Schiffer-0/+24
Based on the work of gnzlbg <gonzalobg88@gmail.com>.
2020-05-18Add tests for asm!Amanieu d'Antras-0/+96
2020-05-18Make `fold` standalone.Nicholas Nethercote-24/+0
`fold` is currently implemented via `try_fold`, but implementing it directly results in slightly less LLVM IR being generated, speeding up compilation of some benchmarks. (And likewise for `rfold`.) The commit adds `fold` implementations to all the iterators that lack one but do have a `try_fold` implementation. Most of these just call the `try_fold` implementation directly.
2020-05-17Test that NRVO elides the call to `memcpy`Dylan MacKenzie-0/+17
2020-05-16Disable MIR optimization for alignment codegen testsDylan MacKenzie-2/+2
NRVO optimizes away the locals whose alignment is tested. I don't think this affects the purpose of the test.
2020-05-11cmdline: Make target features individually overridableVadim Petrochenkov-0/+9
2020-05-09Defer creating drop trees in MIR lowering until leaving that scopeMatthew Jasper-3/+3
2020-05-07Rollup merge of #71952 - JohnTitor:add-tests, r=Dylan-DPCDylan DPC-0/+25
Add some regression tests Closes #29988 Closes #34979 Pick up two snippets that have been fixed from #67945 (shouldn't be closed yet!)
2020-05-08Add some skip flagsYuki Okushi-1/+4
2020-05-07Add test for #29988Yuki Okushi-0/+22
2020-05-06Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikicDylan DPC-6/+6
Define UB in float-to-int casts to saturate This closes #10184 by defining the behavior there to saturate infinities and values exceeding the integral range (on the lower or upper end). `NaN` is sent to zero.
2020-05-06Define UB in float-to-int casts to saturateMark Rousskov-6/+6
- Round to zero, and representable values cast directly. - `NaN` goes to 0 - Values beyond the limits of the type are saturated to the "nearest value" (essentially rounding to zero, in some sense) in the integral type, so e.g. `f32::INFINITY` would go to `{u,i}N::MAX.`
2020-05-04Add Option to Force Unwind TablesSam Elliott-0/+7
When panic != unwind, `nounwind` is added to all functions for a target. This can cause issues when a panic happens with RUST_BACKTRACE=1, as there needs to be a way to reconstruct the backtrace. There are three possible sources of this information: forcing frame pointers (for which an option exists already), debug info (for which an option exists), or unwind tables. Especially for embedded devices, forcing frame pointers can have code size overheads (RISC-V sees ~10% overheads, ARM sees ~2-3% overheads). In code, it can be the case that debug info is not kept, so it is useful to provide this third option, unwind tables, that users can use to reconstruct the call stack. Reconstructing this stack is harder than with frame pointers, but it is still possible. This commit adds a compiler option which allows a user to force the addition of unwind tables. Unwind tables cannot be disabled on targets that require them for correctness, or when using `-C panic=unwind`.
2020-04-20Fix codegen and mir-opt testsJonas Schievink-2/+2
Mostly renamed allocations, but I'm not sure about the const prop tests