Commit graph

515 commits

Author SHA1 Message Date
Christopher Serr
4c08451fc4 Add codegen tests 2020-07-02 09:32:09 +02:00
Manish Goregaokar
45ec25e088
Rollup merge of #73525 - cuviper:llvm11, r=nikic
Prepare for LLVM 11

These are just the code changes needed to build with the current LLVM master (version 11).

r? @nikic
2020-06-27 22:29:54 -07:00
Manish Goregaokar
14dc103a85
Rollup merge of #72620 - tmiasko:linkage-name, r=eddyb
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-26 00:38:56 -07:00
Josh Stone
49f6166ef7 Prepare for LLVM 11 2020-06-25 18:52:41 -07:00
Tyler Mandry
887fbd9d34 Split out async fn and generator test
This keeps FileCheck from tripping over unimportant differences in
codegen.
2020-06-24 15:08:59 -07:00
Tyler Mandry
fe3df646fe Give up on checking filename 2020-06-24 15:08:59 -07:00
Tyler Mandry
2d652d9d73 Add generator-debug test for MSVC
..which doesn't use variant types.
2020-06-24 15:08:59 -07:00
Tyler Mandry
477ecc51ca Generalize generator-debug test a bit
Don't be so reliant on particular line ordering (though FileCheck makes
this hard in general, IMO). Also disable for MSVC.
2020-06-24 14:53:30 -07:00
Tyler Mandry
367858aedc Add test for generator debuginfo 2020-06-24 14:53:29 -07:00
bors
7058471ade Auto merge of #73563 - Manishearth:rollup-oowgwwm, r=Manishearth
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-20 22:53:46 +00:00
Camelid
820bba1c46 Add codegen test for multiple asm! options 2020-06-20 11:12:42 -07:00
Ralf Jung
91bd3337e3
Rollup merge of #73404 - ajpaverd:cfguard_syntax, r=Mark-Simulacrum
Update CFGuard syntax

Update the naming and syntax of the control-flow-guard option, as discussed in #68793.

r? @Mark-Simulacrum
2020-06-20 16:39:53 +02:00
Ralf Jung
125c196bca
Rollup merge of #73054 - RalfJung:dont-panic, r=Mark-Simulacrum
memory access sanity checks: abort instead of panic

Suggested by @Mark-Simulacrum, this should help reduce the performance impact of these checks.
2020-06-19 14:29:24 +02:00
Ralf Jung
0851036ae3
Rollup merge of #73044 - tmiasko:compiletest-san, r=nikomatsakis
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-19 14:29:22 +02:00
Ralf Jung
7d3238f9b9
Rollup merge of #73362 - erikdesjardins:bounds, r=nikomatsakis
Test that bounds checks are elided when slice len is checked up-front

Closes #69101
2020-06-19 08:56:13 +02:00
erikdesjardins
6351850d8f
ignore-debug: debug assertions in slice indexing prevent the optimization 2020-06-17 13:10:49 -04:00
Ralf Jung
81c7ebd544 we can enable one more codegen test in debug mode now 2020-06-16 16:01:30 -04:00
Andrew Paverd
83e6c0e986 Update CFGuard syntax 2020-06-16 17:44:03 +01:00
Erik Desjardins
e0975b9b01 elaborate, add check for exact bounds 2020-06-15 18:19:54 -04:00
Nathan Corbyn
e8e0a0e4e2 Update sanitizer test 2020-06-15 11:12:19 +01:00
Nathan Corbyn
babda9470e Fix sanitizer test 2020-06-15 10:21:19 +01:00
Nathan Corbyn
11b56fbfb6 Fix whitespace 2020-06-15 09:40:57 +01:00
Nathan Corbyn
ee810a75e4 Fix exports with #[inline(always)] 2020-06-15 09:40:56 +01:00
Nathan Corbyn
d23bedd13d Fix whitespace 2020-06-15 09:40:56 +01:00
Nathan Corbyn
6b7cacb2c9 Export all fns with extern indicator 2020-06-15 09:40:56 +01:00
Nathan Corbyn
f62903b74a Export #[inline] #[no_mangle] fns in cdylibs and staticlibs 2020-06-15 09:40:56 +01:00
Erik Desjardins
0906066ae7 Test that bounds checks are elided when slice len is checked up-front 2020-06-15 01:00:46 -04:00
Tomasz Miąsko
d40e624a36 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.
2020-06-13 14:24:30 +02:00
Dylan DPC
4dd5d5d4d6
Rollup merge of #72977 - tblah:riscv-codegen-llvm10, r=nikomatsakis
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-07 18:11:29 +02:00
Felix S. Klock II
e1ebdeeefb Revert "Defer creating drop trees in MIR lowering until leaving that scope"
This reverts commit 611988551f.
2020-06-04 11:34:42 -04:00
Tom Eccles
08529aff80 test: codegen: skip catch-unwind on riscv64
It isn't clear to me if this is a bug or not, hence the FIXME
2020-06-04 12:15:26 +01:00
Tom Eccles
37e8e05712 test: codegen: Add riscv abi llvm intrinsics test 2020-06-04 12:02:03 +01:00
Tom Eccles
c872dcf956 test: codegen: riscv64-abi: print value numbers for unnamed func args
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-04 12:02:03 +01:00
Tom Eccles
95e9768da1 test: codegen: skip tests inappropriate for riscv64 2020-06-04 12:02:03 +01:00
Tomasz Miąsko
e4b7d2c507 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.
2020-05-27 18:36:32 +02:00
Alex Gaynor
cd5f228acd
Added a codegen test for a recent optimization for overflow-checks=on
Closes #58692
2020-05-24 16:20:02 -04:00
bors
148c125b1b Auto merge of #71718 - NeoRaider:ffi_const_pure, r=Amanieu
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-21 15:02:08 +00:00
bors
7f79e98c03 Auto merge of #72205 - ecstatic-morse:nrvo, r=oli-obk
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-21 07:16:44 +00:00
Dylan DPC
5c52f9f916
Rollup merge of #72139 - nnethercote:standalone-fold, r=cuviper
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-20 14:21:06 +02:00
Matthias Schiffer
a7d7f0bbe9 Add tests for #[ffi_const] and #[ffi_pure] function attributes
Based on the work of gnzlbg <gonzalobg88@gmail.com>.
2020-05-20 01:16:11 +02:00
Amanieu d'Antras
8ab0f2d3c5 Add tests for asm! 2020-05-18 14:41:32 +01:00
Nicholas Nethercote
4b7c3d88c6 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.

(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-18 05:41:59 +10:00
Dylan MacKenzie
856cd6609f Test that NRVO elides the call to memcpy 2020-05-17 10:24:06 -07:00
Dylan MacKenzie
8c710118f6 Disable MIR optimization for alignment codegen tests
NRVO optimizes away the locals whose alignment is tested. I don't think
this affects the purpose of the test.
2020-05-16 17:15:24 -07:00
Vadim Petrochenkov
00dcb665e7 cmdline: Make target features individually overridable 2020-05-11 02:04:53 +03:00
Matthew Jasper
611988551f Defer creating drop trees in MIR lowering until leaving that scope 2020-05-09 10:50:55 +01:00
Dylan DPC
480f718158
Rollup merge of #71952 - JohnTitor:add-tests, r=Dylan-DPC
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-07 17:58:53 +02:00
Yuki Okushi
d717e55f19
Add some skip flags 2020-05-08 00:51:13 +09:00
Yuki Okushi
96d4e0bab2
Add test for #29988 2020-05-07 02:22:08 +09:00
Dylan DPC
14d608f1d8
Rollup merge of #71269 - Mark-Simulacrum:sat-float-casts, r=nikic
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-06 16:58:50 +02:00