Commit Graph

302 Commits

Author SHA1 Message Date
Guillaume Gomez 38eb369fa4 Enforce Python 3 as much as possible 2020-04-10 09:09:58 -04:00
Vadim Petrochenkov 13bd25e472 Do not lose or reorder user-provided linker arguments 2020-04-04 22:01:18 +03:00
Mazdak Farrokhzad 0826009638 fix fulldeps test fallout 2020-04-02 13:40:43 +02:00
Mazdak Farrokhzad 2a92839147 rustc -> rustc_middle part 5 -- fix tests 2020-03-30 07:21:44 +02:00
Mazdak Farrokhzad 08e867cc3a
Rollup merge of #70345 - nnethercote:rm-no_integrated_as, r=alexcrichton
Remove `no_integrated_as` mode.

Specifically, remove both `-Z no_integrated_as` and
`TargetOptions::no_integrated_as`. The latter was only used for the
`msp430_none_elf` platform, for which it's no longer required.

r? @alexcrichton
2020-03-27 22:39:37 +01:00
Nicholas Nethercote 02840ca8ab Remove `no_integrated_as` mode.
Specifically, remove both `-Z no_integrated_as` and
`TargetOptions::no_integrated_as`. The latter was only used for the
`msp430_none_elf` platform, for which it's no longer required.
2020-03-27 11:59:10 +11:00
Amanieu d'Antras 1cc521ef9d Update tests to use llvm_asm! 2020-03-26 15:49:22 +00:00
bjorn3 33cd9a2515
Mark hotplug_codegen_backend as ignore-stage1 2020-03-24 20:21:50 +01:00
bors 374ab25585 Auto merge of #70163 - nikic:llvm-10-preparation, r=cuviper
Prepare for LLVM 10 upgrade

This is #67759 minus the submodule update.

 * Fix two compatibility issues in the rustllvm wrapper.
 * Update data layout strings in tests.
 * Fix LLVM version comparison (this become a problem because the major version has two digits now).

r? @cuviper
2020-03-24 12:42:54 +00:00
Mark Mansi 2d75a339ca Refactorings to begin getting rid of rustc_codegen_utils 2020-03-19 23:14:46 -05:00
Nikita Popov 66008eb9e4 Adjust data layout in test 2020-03-19 20:09:57 +01:00
Mazdak Farrokhzad 4392a8b73c use direct imports for `rustc::{lint, session}`. 2020-03-16 02:52:06 +01:00
Tomasz Miąsko 44dba79124 Add regression test for linking issue with start-group / end-group 2020-03-03 13:11:23 +01:00
Mazdak Farrokhzad 5e2a095ba0
Rollup merge of #69146 - matthewjasper:literal-qualif, r=eddyb
Always const qualify literals by type

r? @eddyb
2020-02-18 22:16:23 +01:00
Matthew Jasper 0663f25375 Always qualify literals by type 2020-02-15 14:41:34 +00:00
Alberto Piai ea2ffda44e
add regression test for issue #68794
This is a minimal regression test for the issue #68794: "TEXTREL in
i686", which was fixed with e86019c4a0.

The test links a minimal rust static library into a shared library, and
checks that the linker didn't have to add the TEXTREL flag.
2020-02-14 14:38:31 +01:00
Eduard-Mihai Burtescu d20e4aa8e3 test: use `all: $(call NATIVE_STATICLIB,test)` to build a C lib. 2020-02-08 13:40:50 +02:00
Eduard-Mihai Burtescu d69b3b16e5 test: address comments and pacify the merciless tidy. 2020-02-08 06:52:09 +02:00
John VanEnk 3b23b9864c Two test cases where Rust calls C using enums by value
One calls into C functions passing non-c-like enumerations by
value. The other calls into C expecting non-C-like enumerations as
returns.

These test cases are based on the tests provided by @bitwalker on
issue #68190. The original tests were provided at:
2688d5c672
2020-02-08 06:50:59 +02:00
John VanEnk 26bb0f15e7 Add similar examples that work to each test. 2020-02-08 06:17:03 +02:00
John VanEnk f1b52b34f2 Add a test that demonstrates an incorrect return value when calling into rust with non-c-like-enums. 2020-02-08 06:17:03 +02:00
John VanEnk cd5ad993d0 Add a test that demonstrates a segfault when calling into rust with non-c-like-enum. 2020-02-08 06:17:02 +02:00
Victor Ding ae51d2ba32 Split `join_codegen_and_link()` into two steps
`join_codegen_and_link()` is split to `join_codegen()` and `link()`.
2020-02-04 11:09:50 +11:00
bors 80a65bcaf2 Auto merge of #68448 - maurer:dyn-cdylib, r=alexcrichton
rustc: Allow cdylibs to link against dylibs

Previously, rustc mandated that cdylibs could only link against rlibs as dependencies (not dylibs).
This commit disables that restriction and tests that it works in a simple case.

I don't have a windows rustc dev environment, so I guessed at the MSVC test code, I'm hoping the CI can run that for me.

Additionally, we might want to consider emitting (through cargo or rustc) some metadata to help C users of a cdylib figure out where all the dylibs they need are. I don't think that should be needed to land this change, as it will still be usable by homogeneous build systems without it.

My new test was templated off the `tests/run-make-fulldeps/cdylib` test. It seemed more appropriate to have it as a separate test, since both foo.rs and bar.rs would need to be replicated to make that test cover both cases, but I can do that if it would be preferred.

If I'm doing anything out of order/process, please let me know; this is only my second change to rustc and the prior one was trivial.

r? alexcrichton
2020-01-25 07:49:40 +00:00
Tomasz Miąsko 2fd6c4a18a Remove unused ignore-license directives
The tidy check was removed in rust-lang/rust#53617
2020-01-24 00:00:00 +00:00
Matthew Maurer 72aaa3a414 rustc: Allow cdylibs to link against dylibs
Previously, rustc mandated that cdylibs could only link against rlibs as
dependencies (not dylibs).
This commit disables that restriction and tests that it works in a
simple case.
2020-01-23 13:10:04 -08:00
Michael Woerister 0a9bcb0adf Add regression test for #64319 back in.
The regression test is originally from #64324 but was removed again
after the fix in there turned out to break other things.
2020-01-20 12:00:43 +01:00
Michael Woerister ce6995f98e Add regression test for shared-generics x dylibs (#67276). 2020-01-20 12:00:43 +01:00
Tomasz Miąsko ea64a33943 Update sanitizer tests
* Move tests from src/test/run-make-fulldeps to src/test/ui.
* Fix memory sanitizer test to detect the intended issue rather than
  an unrelated one caused by the use of an uninstrumented std.
2020-01-16 00:00:00 +00:00
Dylan DPC 678f662e54
Rollup merge of #68244 - tmiasko:leak, r=Centril
Enable leak sanitizer test case

* Use `black_box` to avoid memory leak removal during optimization.
* Leak multiple objects to make test case more robust.
2020-01-16 20:53:27 +05:30
Dylan DPC 1389caf860
Rollup merge of #68096 - varkor:diagnostic-cleanup, r=Centril
Clean up some diagnostics by making them more consistent

In general:

- Diagnostic should start with a lowercase letter.
- Diagnostics should not end with a full stop.
- Ellipses contain three dots.
- Backticks should encode Rust code.

I also reworded a couple of messages to make them read more clearly.

It might be sensible to create a style guide for diagnostics, so these informal conventions are written down somewhere, after which we could audit the existing diagnostics.

r? @Centril
2020-01-16 11:58:02 +05:30
Tomasz Miąsko 5d00b5c4aa Enable leak sanitizer test case
* Use `black_box` to avoid memory leak removal during optimization.
* Leak multiple objects to make test case more robust.
2020-01-15 18:36:42 +01:00
varkor 1faa05daac Update `output-default.json` and rustdoc test 2020-01-12 15:37:50 +00:00
Amanieu d'Antras 3a025760be Abort if C++ tries to swallow a Rust panic 2020-01-11 10:18:44 +00:00
Amanieu d'Antras 4361192112 Add a test to check that swallowed Rust panics are dropped properly. 2020-01-11 10:18:44 +00:00
Tomasz Miąsko 0c6b1a7e3c Link sanitizer runtimes instead of injecting crate dependencies 2020-01-09 07:54:02 +01:00
Mazdak Farrokhzad 2c3e5d3de0 - remove syntax::{span_warn!, span_err!, span_fatal!. struct_err!}
- remove syntax::{help!, span_help!, span_note!}
- remove unused syntax::{struct_span_fatal, struct_span_err_or_warn!, span_err_or_warn!}
- lintify check_for_bindings_named_same_as_variants + conflicting_repr_hints
- inline syntax::{struct_span_warn!, diagnostic_used!}
- stringify_error_code! -> error_code! & use it more.
- find_plugin_registrar: de-fatalize an error
- de-fatalize metadata errors
- move type_error_struct! to rustc_typeck
- struct_span_err! -> rustc_errors
2020-01-08 04:25:33 +01:00
Mazdak Farrokhzad 01563682c6 fix ui-fulldeps fallout 2020-01-05 12:49:22 +01:00
Mazdak Farrokhzad 814e3af8bd
Rollup merge of #67786 - Centril:canon-span, r=petrochenkov
Nix reexports from `rustc_span` in `syntax`

Remove reexports `syntax::{source_map, symbol, edition}` and use `rustc_span` paths directly.

r? @petrochenkov
2020-01-04 02:19:49 +01:00
Michael Woerister 971aa2bd62 Attempt to fix intermittent failures of pgo-branch-weights test. 2020-01-03 10:40:15 +01:00
Mazdak Farrokhzad 6e4ea1476a fix src/test fallout 2020-01-02 22:12:46 +01:00
Mark Rousskov c205f6a06a Remove mem::uninitalized from tests
This purges uses of uninitialized where possible from test cases. Some
are merely moved over to the equally bad pattern of
MaybeUninit::uninit().assume_init() but with an annotation that this is
"the best we can do".
2019-12-22 21:58:12 -05:00
Ross MacArthur f7256d28d1
Require issue = "none" over issue = "0" in unstable attributes 2019-12-21 13:16:18 +02:00
Josh Stone 2304c25f31 Update the minimum external LLVM to 7
LLVM 7 is over a year old, which should be plenty for compatibility. The
last LLVM 6 holdout was llvm-emscripten, which went away in #65501.

I've also included a fix for LLVM 8 lacking `MemorySanitizerOptions`,
which was broken by #66522.
2019-12-02 11:36:21 -08:00
Ralf Jung 6ea1df2340
Rollup merge of #66791 - cjgillot:arena, r=Mark-Simulacrum
Handle GlobalCtxt directly from librustc_interface query system

This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface.
This simplifies the code to construct it, at the expense of added complexity in the query control flow.
This allows to handle the arenas directly from librustc_interface.

Based on #66707

r? @Zoxc
2019-11-29 22:57:34 +01:00
bors 3907d59bcf Auto merge of #66547 - leo60228:procfs-fallback, r=dtolnay
Fallback to .init_array when no arguments are available on glibc Linux

Linux is one of the only platforms where `std::env::args` doesn't work in a cdylib.
2019-11-29 05:04:51 +00:00
bors 1dc3686f8b Auto merge of #66631 - michaelwoerister:additional-pgo-tests, r=alexcrichton
Add additional regression tests for PGO

This PR adds regression tests for making sure that
- instrumentation records the right counts for branches taken and functions called, and that
- the indirect call promotion pass actually is able to promote indirect calls.

r? @alexcrichton
2019-11-26 12:35:39 +00:00
Michael Woerister 34fbc718d1 PGO: Make branch-weights regression test more robust. 2019-11-26 10:34:48 +01:00
Camille GILLOT becfe5c153 Fix test. 2019-11-24 23:21:44 +01:00
Mazdak Farrokhzad c66b508137
Rollup merge of #66575 - Mark-Simulacrum:no-uii, r=petrochenkov
Remove pretty printing of specific nodes in AST

The ability to print a specific item as identified by NodeId or path
seems not particularly useful, and certainly carries quite a bit of
complexity with it.

This is intended to simplify our CLI parsing a bit and remove a
non-uncomplicated piece of it; I largely did this to remove the
dependency on NodeId from librustc/session but it's not really
necessary to do so in this invasive a way. The alternative is
moving it to librustc_interface or driver, probably.
2019-11-22 19:57:48 +01:00