Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error output between self-hosted versus cross-compile target differs significantly for some tests #23926

Closed
pnkfelix opened this issue Apr 1, 2015 · 5 comments
Assignees
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Apr 1, 2015

The error output between self-hosted versus cross-compile target can differ significantly for some tests.

In some cases one can get around this via error-pattern, but it does not work universally.

This bug is to mark such cases, and hopefully go back and identify why the error output is so different (in some cases the reason may be self-evident, but that was not universally true).

pnkfelix added a commit to pnkfelix/rust that referenced this issue Apr 1, 2015
@pnkfelix
Copy link
Member Author

pnkfelix commented Apr 1, 2015

Ah this case
https://github.com/rust-lang/rust/blob/2a9de1d989d7f95846b711eec2695cbd86794ee3/src/test/compile-fail/huge-array-simple.rs
is one of the ones that seems self-evident:

  • on 32-bit hosts, the shift overflows.
  • But on 64-bit hosts, the shift succeeds, and then the attempt to create the huge array overflows.

Maybe the easiest thing would be to make 32- and 64-bit variants of that same test. (That or conditionalize the size we feed into the array construction based on pointer size.)

Update: another thing to maybe check is to see if trying to allocate an [u8, (1<<31)] array on the stack causes the same compile-time failure on both targets.

@steveklabnik
Copy link
Member

Triage: no changes I'm aware of.

@Mark-Simulacrum
Copy link
Member

There are two other tests currently tagged with this issue, const-eval-overflow-3.rs and const-eval-overflow-3b.rs, both in compile-fail. The issue with both appears to be the same as with the previous test mentioned; we either can or cannot create and evaluate the const array depending on platform.

@Mark-Simulacrum Mark-Simulacrum added A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. labels Jul 22, 2017
@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Sep 21, 2018
@pnkfelix
Copy link
Member Author

I wonder if we might be able to leverage the revision system in some way here. That, or as I noted earlier: make pointer-size-specific variants of each test. (And then presumably ignore the tests on platforms that cannot support the 64-bit pointer-sized variant.)

@pnkfelix
Copy link
Member Author

Better solution: make target-specific versions of each fn main with a customized const expression for the target of interest, and then use // normalize-stderr-test REGEXP -> OUTPUT to normalize to a single canonical output for the test.

pnkfelix added a commit to pnkfelix/rust that referenced this issue Feb 22, 2019
AFAICT, we do not have the same const-eval issues that we used to when
rust-lang#23926 was filed. (Probably because of the switch to
miri for const-evaluation.)
Centril added a commit to Centril/rust that referenced this issue Feb 23, 2019
…r=nikomatsakis

Update tests to account for cross-platform testing and miri.

Fix rust-lang#23926
Centril added a commit to Centril/rust that referenced this issue Feb 23, 2019
…r=nikomatsakis

Update tests to account for cross-platform testing and miri.

Fix rust-lang#23926
Centril added a commit to Centril/rust that referenced this issue Feb 23, 2019
…r=nikomatsakis

Update tests to account for cross-platform testing and miri.

Fix rust-lang#23926
Centril added a commit to Centril/rust that referenced this issue Feb 23, 2019
…r=nikomatsakis

Update tests to account for cross-platform testing and miri.

Fix rust-lang#23926
Centril added a commit to Centril/rust that referenced this issue Feb 23, 2019
…r=nikomatsakis

Update tests to account for cross-platform testing and miri.

Fix rust-lang#23926
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants