Converted Rust Test Case to DejaGnu
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
Additionally, there are some mismatches between rustc error output and gccrs error outputs. I also need to look into that.
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.
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
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?