gccrs icon indicating copy to clipboard operation
gccrs copied to clipboard

Converted Rust Test Case to DejaGnu

Open MahadMuhammad opened this issue 1 year ago • 4 comments

A very simple PR to Investigate test case from https://github.com/rust-lang/rust/tree/master/tests/ui/anon-params. To convert this into equivalent Rust source file with dejagnu directives instead of ERROR directives


gcc/testsuite/ChangeLog:

* rust/compile/anon-params-denied-2018.rs: New test.
* rust/compile/anon-params-deprecated.rs: New test.

Details

Thanks to this email thread: https://patchwork.ozlabs.org/project/gcc/patch/[email protected]/. I was able to understand the relative line number. Otherwise, it would be difficult to stop dejagnu from shouting

MahadMuhammad avatar Jun 27 '24 12:06 MahadMuhammad

Additionally, there are some mismatches between rustc error output and gccrs error outputs. I also need to look into that.

MahadMuhammad avatar Jun 27 '24 12:06 MahadMuhammad

I suggest we eventually put these "external" test cases into a separate directory, which then also contains some README file describing where they're coming from, and which exact upstream revision they're based on.

You may extend the glob in gcc/testsuite/rust/compile/compile.exp to look into that new directory, too, or have a separate *.exp file in the new directory, if that's maybe useful for other reasons (like, to specify default compilation flags to dg-runtest). See, for example, gcc/testsuite/gcc.dg/gomp/gomp.exp search two directories by default, and specify -fopenmp by default.

tschwinge avatar Jul 01 '24 10:07 tschwinge

yeah, I believe the best thing would be to go with a separate .exp file because we might eventually want to tweak it as you said Thomas. so I would just copy the compile.exp file so that it works for that new directory

CohenArthur avatar Jul 03 '24 09:07 CohenArthur

Sure. I'll work on that. Also, the test cases in this PR have very different output on rustc (see this: https://godbolt.org/z/MGdE35PPT). So, should I update this PR with only with the error codes of rustc?

MahadMuhammad avatar Jul 03 '24 17:07 MahadMuhammad