about summary refs log tree commit diff
path: root/src/test/codegen
AgeCommit message (Collapse)AuthorLines
2021-01-15Rollup merge of #80834 - bugadani:vecdeque, r=oli-obkYuki Okushi-0/+19
Remove unreachable panics from VecDeque::{front/back}[_mut] `VecDeque`'s `front`, `front_mut`, `back` and `back_mut` methods are implemented in terms of the index operator, which causes these functions to contain [unreachable panic calls](https://rust.godbolt.org/z/MTnq1o). This PR reimplements these methods in terms of `get[_mut]` instead.
2021-01-14Use probe-stack=inline-asm in LLVM 11+Erik Desjardins-1/+2
2021-01-14Remove unreachable panics from VecDequeDániel Buga-0/+19
2021-01-13Update code to account for extern ABI requirementMark Rousskov-35/+35
2021-01-13Update tests for extern block lintingMark Rousskov-9/+9
2020-12-31Merge remote-tracking branch 'origin/master' into frewsxcv-sanCorey Farwell-0/+101
2020-12-31remove move_val_init leftoversRalf Jung-19/+0
2020-12-26Remove pointer comparison from slice equalitybors-0/+16
This resurrects #71735. Fixes #71602, helps with #80140. r? `@Mark-Simulacrum`
2020-12-10Fix typo in code commentCorey Farwell-1/+1
2020-12-10tests: codegen/transmute-scalar needs optimizations enabled.Eduard-Mihai Burtescu-1/+1
2020-12-09tests: add 3 cases involving pointers to codegen/transmute-scalar.Eduard-Mihai Burtescu-0/+50
2020-12-07rustc_codegen_ssa: use bitcasts instead of type punning for scalar transmutes.Eduard-Mihai Burtescu-0/+35
2020-11-30make test work in llvm 9Erik Desjardins-1/+1
2020-11-29Pass arguments up to 2*usize by valueErik Desjardins-5/+10
2020-11-29Auto merge of #78380 - bstrie:rm-old-num-const-from-tests, r=jyn514bors-5/+4
Update tests to remove old numeric constants Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-29Auto merge of #78863 - KodrAus:feat/simd-array, r=oli-obkbors-0/+91
Support repr(simd) on ADTs containing a single array field This is a squash and rebase of `@gnzlbg's` #63531 I've never actually written code in the compiler before so just fumbled my way around until it would build 😅 I imagine there'll be some work we need to do in `rustc_codegen_cranelift` too for this now, but might need some input from `@bjorn3` to know what that is. cc `@rust-lang/project-portable-simd` ----- This PR allows using `#[repr(simd)]` on ADTs containing a single array field: ```rust #[repr(simd)] struct S0([f32; 4]); #[repr(simd)] struct S1<const N: usize>([f32; N]); #[repr(simd)] struct S2<T, const N: usize>([T; N]); ``` This should allow experimenting with portable packed SIMD abstractions on nightly that make use of const generics.
2020-11-29args may be passed by valueAshley Mannix-4/+4
2020-11-29Update tests to remove old numeric constantsbstrie-5/+4
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-29looser regex on local argsAshley Mannix-6/+6
2020-11-25Validate use of parameters in naked functionsTomasz Miąsko-49/+5
* Reject use of parameters inside naked function body. * Reject use of patterns inside function parameters, to emphasize role of parameters a signature declaration (mirroring existing behaviour for function declarations) and avoid generating code introducing specified bindings.
2020-11-24Rollup merge of #79346 - tmiasko:more-names, r=jonas-schievinkJonas Schievink-0/+20
Allow using `-Z fewer-names=no` to retain value names Change `-Z fewer-names` into an optional boolean flag and allow using it to either discard value names when true or retain them when false, regardless of other settings.
2020-11-24generalize codegen to non 64bit platformsAshley Mannix-6/+6
2020-11-23Auto merge of #78439 - lzutao:rm-clouldabi, r=Mark-Simulacrumbors-2/+0
Drop support for all cloudabi targets `cloudabi` is a tier-3 target, and [it is no longer being maintained upstream][no]. This PR drops supports for cloudabi targets. Those targets are: * aarch64-unknown-cloudabi * armv7-unknown-cloudabi * i686-unknown-cloudabi * x86_64-unknown-cloudabi Since this drops supports for a target, I'd like somebody to tag `relnotes` label to this PR. Some other issues: * The tidy exception for `cloudabi` crate is still remained because * `parking_lot v0.9.0` and `parking_lot v0.10.2` depends on `cloudabi v0.0.3`. * `parking_lot v0.11.0` depends on `cloudabi v0.1.0`. [no]: https://github.com/NuxiNL/cloudabi#note-this-project-is-unmaintained
2020-11-23Allow using `-Z fewer-names=no` to retain value namesTomasz Miąsko-0/+20
Change `-Z fewer-names` into an optional boolean flag and allow using it to either discard value names when true or retain them when false, regardless of other settings.
2020-11-22Change slice::to_vec to not use extend_from_slicekadmin-0/+10
This also required adding a loop guard in case clone panics Add specialization for copy There is a better version for copy, so I've added specialization for that function and hopefully that should speed it up even more. Switch FromIter<slice::Iter> to use `to_vec` Test different unrolling version for to_vec Revert to impl From benchmarking, it appears this version is faster
2020-11-22Drop support for cloudabi targetsLzu Tao-2/+0
2020-11-20Never inline naked functionsTomasz Miąsko-0/+30
The `#[naked]` attribute disabled prologue / epilogue emission for the function and it is responsibility of a developer to provide them. The compiler is no position to inline such functions correctly. Disable inlining of naked functions at LLVM and MIR level.
2020-11-18Auto merge of #79106 - tmiasko:inline-hint, r=nagisa,eddybbors-0/+31
Fix setting inline hint based on `InstanceDef::requires_inline` For instances where `InstanceDef::requires_inline` is true, an attempt is made to set an inline hint though a call to the `inline` function. The attempt is ineffective, since all attributes will be usually removed by the second call. Fix the issue by applying the attributes only once, with user provided attributes having a priority when provided. Closes #79108.
2020-11-17Rollup merge of #78967 - tmiasko:codegen-tests, r=cuviperMara Bos-9/+17
Make codegen tests compatible with extra inlining
2020-11-17Fix setting inline hint based on `InstanceDef::requires_inline`Tomasz Miąsko-0/+31
For instances where `InstanceDef::requires_inline` is true, an attempt is made to set an inline hint though a call to the `inline` function. The attempt is ineffective, since all attributes will be usually removed by the second call. Fix the issue by applying the attributes only once, with user provided attributes having a priority when provided.
2020-11-14tweak new codegen test to work on localAshley Mannix-4/+4
2020-11-13remove const_generics from codegen testsAshley Mannix-4/+4
2020-11-12fully exploited the dropped support of LLVM 8DevJPM-2/+0
This commit grepped for LLVM_VERSION_GE, LLVM_VERSION_LT, get_major_version and min-llvm-version and statically evaluated every expression possible (and sensible) assuming that the LLVM version is >=9 now
2020-11-12Fix codegen test for issue 37945Tomasz Miąsko-6/+14
2020-11-12Ensure that closure call is not removed by MIR optimizations in a testTomasz Miąsko-1/+1
2020-11-12Fix test checking that into_boxed_slice does not panicTomasz Miąsko-2/+2
The memory allocation in vec might panic in the case of capacity overflow. Move the allocation outside the function to fix the test.
2020-11-08Support repr(simd) on ADTs containing a single array fieldgnzlbg-0/+91
This PR allows using `#[repr(simd)]` on ADTs containing a single array field: ```rust #[repr(simd)] struct S0([f32; 4]); #[repr(simd)] struct S1<const N: usize>([f32; N]); #[repr(simd)] struct S2<T, const N: usize>([T; N]); ``` This should allow experimenting with portable packed SIMD abstractions on nightly that make use of const generics.
2020-11-03Rollup merge of #77950 - arlosi:sha256, r=eddybMara Bos-0/+7
Add support for SHA256 source file hashing Adds support for `-Z src-hash-algorithm sha256`, which became available in LLVM 11. Using an older version of LLVM will cause an error `invalid checksum kind` if the hash algorithm is set to sha256. r? `@eddyb` cc #70401 `@est31`
2020-10-31Assert that locals have storage when usedTomasz Miąsko-0/+1
The validator in visit_local asserts that local has a stroage when used, but visit_local is never called so validation is ineffective. Use super_statement and super_terminator to ensure that locals are visited.
2020-10-26Auto merge of #77876 - tmiasko:simplify-locals, r=wesleywiserbors-6/+6
Remove unused set-discriminant statements and assignments regardless of rvalue * Represent use counts with u32 * Unify use count visitors * Change RemoveStatements visitor into a function * Remove unused set-discriminant statements * Use exhaustive match to clarify what is being optimized * Remove unused assignments regardless of rvalue kind
2020-10-26Auto merge of #68965 - eddyb:mir-inline-scope, r=nagisa,oli-obkbors-0/+17
rustc_mir: track inlined callees in SourceScopeData. We now record which MIR scopes are the roots of *other* (inlined) functions's scope trees, which allows us to generate the correct debuginfo in codegen, similar to what LLVM inlining generates. This PR makes the `ui` test `backtrace-debuginfo` pass, if the MIR inliner is turned on by default. Also, `#[track_caller]` is now correct in the face of MIR inlining (cc `@anp).` Fixes #76997. r? `@rust-lang/wg-mir-opt`
2020-10-26Ignore long lines in testoli-0/+1
2020-10-26Add an inlining debuginfo testoli-0/+16
2020-10-26simplify-locals: Remove unused assignments regardless of rvalue kindTomasz Miąsko-6/+6
2020-10-23Add codegen test for #45964Dániel Buga-0/+38
2020-10-20Rollup merge of #78046 - bugadani:issue-73827, r=nikicGuillaume Gomez-0/+18
Add codegen test for issue #73827 Closes #73827
2020-10-17Add codegen test for issue #73827Dániel Buga-0/+18
2020-10-15Prevent miscompilation in trivial loop {}Mark Rousskov-0/+15
Ideally, we would want to handle a broader set of cases to fully fix the underlying bug here. That is currently relatively expensive at compile and runtime, so we don't do that for now.
2020-10-14Add support for SHA256 source file hashing for LLVM 11+.Arlo Siemsen-0/+7
2020-10-13Auto merge of #76830 - Artoria2e5:tune, r=nagisabors-0/+21
Pass tune-cpu to LLVM I think this is how it should work... See https://internals.rust-lang.org/t/expose-tune-cpu-from-llvm/13088 for the background. Or the documentation diff.