writing DMD tests for inline assembly bugs

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Thu Oct 29 10:58:32 PDT 2015


On 10/29/2015 5:44 AM, Cauterite wrote:
> while working on issue 15235 I've been trying to add some new tests for DMD.
>
> The tests I want to write involve checking that certain asm statements throw
> syntax errors instead of segfaults, but the fact that asmerr() ends compilation
> unconditionally is proving to be a problem. __traits(compiles, …) doesn't help
> (as discovered in issue 15257).
>
> The only solution I can think of would be to have a separate test for each
> statement. Anyone got a better idea?

The usual technique in the D test suite is to pipe the output to a file, and 
then diff against what it should be. Yes, you wind up with about one test file 
per error message.

https://github.com/D-Programming-Language/dmd/tree/master/test/fail_compilation


More information about the Digitalmars-d mailing list