about summary refs log tree commit diff
path: root/src/test/codegen
AgeCommit message (Collapse)AuthorLines
2020-07-30Auto merge of #74105 - npmccallum:naked, r=matthewjasperbors-2/+2
Suppress debuginfo on naked function arguments A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408
2020-07-27Suppress debuginfo on naked function argumentsNathaniel McCallum-2/+2
A function that has no prologue cannot be reasonably expected to support debuginfo. In fact, the existing code (before this patch) would generate invalid instructions that caused crashes. We can solve this easily by just not emitting the debuginfo in this case. Fixes https://github.com/rust-lang/rust/issues/42779 cc https://github.com/rust-lang/rust/issues/32408
2020-07-25Auto merge of #74510 - LukasKalbertodt:fix-range-from-index-panic, ↵bors-3/+3
r=hanna-kruppe Fix panic message when `RangeFrom` index is out of bounds Before, the `Range` method was called with `end = slice.len()`. Unfortunately, because `Range::index` first checks the order of the indices (start has to be smaller than end), an out of bounds index leads to `core::slice::slice_index_order_fail` being called. This prints the message 'slice index starts at 27 but ends at 10', which is worse than 'index 27 out of range for slice of length 10'. This is not only useful to normal users reading panic messages, but also for people inspecting assembly and being confused by `slice_index_order_fail` calls. You can see the produced assembly [here](https://rust.godbolt.org/z/GzMGWf) and try on Playground [here](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=aada5996b2f3848075a6d02cf4055743). (By the way. this is only about which panic function is called; I'm pretty sure it does not improve anything about performance).
2020-07-22Improve codegen for unchecked float casts on wasmAlex Crichton-20/+9
This commit improves codegen for unchecked casts on WebAssembly targets to use the singluar `iNN.trunc_fMM_{u,s}` instructions. Previously rustc would codegen a bare `fptosi` and `fptoui` for float casts but for WebAssembly targets the codegen for these instructions is quite large. This large codegen is due to the fact that LLVM can speculate these instructions so the trapping behavior of WebAssembly needs to be protected against in case they're speculated. The change here is to update the codegen for the unchecked cast intrinsics to have a wasm-specific case where they call the appropriate LLVM intrinsic to generate the right wasm instruction. The intrinsic is explicitly opting-in to undefined behavior so a trap here for out-of-bounds inputs on wasm should be acceptable. cc #73591
2020-07-22Rollup merge of #74237 - lzutao:compiletest, r=Mark-SimulacrumManish Goregaokar-2/+2
compiletest: Rewrite extract_*_version functions This makes extract_lldb_version has the same version type like extract_gdb_version.
2020-07-22Rollup merge of #73893 - ajpaverd:cfguard-stabilize, r=nikomatsakisManish Goregaokar-4/+4
Stabilize control-flow-guard codegen option This is the stabilization PR discussed in #68793. It converts the `-Z control-flow-guard` debugging option into a codegen option (`-C control-flow-guard`), and changes the associated tests.
2020-07-22[AVR] Correctly set the pointer address space when constructing pointers to ↵Dylan McKay-0/+93
functions This patch extends the existing `type_i8p` method so that it requires an explicit address space to be specified. Before this patch, the `type_i8p` method implcitily assumed the default address space, which is not a safe transformation on all targets, namely AVR. The Rust compiler already has support for tracking the "instruction address space" on a per-target basis. This patch extends the code generation routines so that an address space must always be specified. In my estimation, around 15% of the callers of `type_i8p` produced invalid code on AVR due to the loss of address space prior to LLVM final code generation. This would lead to unavoidable assertion errors relating to invalid bitcasts. With this patch, the address space is always either 1) explicitly set to the instruction address space because the logic is dealing with functions which must be placed there, or 2) explicitly set to the default address space 0 because the logic can only operate on data space pointers and thus we keep the existing semantics of assuming the default, "data" address space.
2020-07-20Slightly improve panic messages when range indices are out of boundsLukas Kalbertodt-3/+3
2020-07-19Add missing : after *llvm-versionLzu Tao-2/+2
2020-07-17Test codegen of compare_exchange operationsTomasz Miąsko-0/+60
2020-07-16Rollup merge of #74171 - ehuss:44056-debug-macos, r=nikomatsakisManish Goregaokar-2/+3
Fix 44056 test with debug on macos. The test `codegen/issue-44056-macos-tls-align.rs` fails on macos if `debug-assertions` is enabled in `config.toml`. It has the following error: ``` /Users/eric/Proj/rust/rust/src/test/codegen/issue-44056-macos-tls-align.rs:9:11: error: CHECK: expected string not found in input // CHECK: @STATIC_VAR_1 = thread_local local_unnamed_addr global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4 ^ /Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:1:1: note: scanning from here ; ModuleID = 'issue_44056_macos_tls_align.3a1fbbbh-cgu.0' ^ /Users/eric/Proj/rust/rust/build/x86_64-apple-darwin/test/codegen/issue-44056-macos-tls-align/issue-44056-macos-tls-align.ll:9:1: note: possible intended match here @STATIC_VAR_1 = thread_local global <{ [32 x i8] }> zeroinitializer, section "__DATA,__thread_bss", align 4 ^ ``` Comparing the output, the actual output is missing the text "`local_unnamed_addr`". The fix here is to ignore `local_unnamed_addr`, as it doesn't seem relevant to the test.
2020-07-16Rollup merge of #73926 - joaopaulocarreiro:github_rust-6, r=nikomatsakisManish Goregaokar-0/+1
Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aarch64 Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aarch64. Copyright (c) 2020, Arm Limited.
2020-07-14Stabilize control-flow-guard codegen optionAndrew Paverd-4/+4
2020-07-13Rollup merge of #74285 - wangtheo:issue-71669, r=lcnrManish Goregaokar-0/+91
#71669: add ui, codegen tests for volatile + nearby int intrinsics Added some tests for intrinsics. See https://github.com/rust-lang/rust/issues/71669.
2020-07-13Added ui tests for volatile and nearby intrinsicsTeddy_Wang-0/+18
2020-07-12Added tests for volatile and nearbyint intrinsicsTeddy_Wang-0/+73
2020-07-10Only add cfguard module flag on windows-msvcAndrew Paverd-0/+14
2020-07-09Ignore changes when debug assertions are enabled.Eric Huss-3/+3
2020-07-08Disable 44056 test with debug on macos.Eric Huss-0/+1
2020-07-02Add codegen testsChristopher Serr-0/+331
2020-07-01Ignoring test case: [codegen] repr-transparent-aggregates-1.rs for aarch64joacar01-0/+1
Copyright (c) 2020, Arm Limited.
2020-06-27Rollup merge of #73525 - cuviper:llvm11, r=nikicManish Goregaokar-3/+3
Prepare for LLVM 11 These are just the code changes needed to build with the current LLVM master (version 11). r? @nikic
2020-06-26Rollup merge of #72620 - tmiasko:linkage-name, r=eddybManish Goregaokar-0/+42
Omit DW_AT_linkage_name when it is the same as DW_AT_name The DWARF standard suggests that it might be useful to include `DW_AT_linkage_name` when it is *distinct* from the identifier name. Fixes #46487. Fixes #59422.
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.