2022-11-03 16:40:13 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
this is an example (not actually a regression test) that shows how to
|
|
|
|
make a check that compares the compiler (error-) output with a provided
|
|
|
|
reference.
|
|
|
|
|
|
|
|
to produce a reference file, first make sure your program "works" as intended,
|
|
|
|
then "make" in this directory once and copy the produced compiler output to
|
|
|
|
the reference:
|
|
|
|
|
|
|
|
$ cp ../../testwrk/ref/custom-reference-error.g.6502.out custom-reference-error.cref
|
|
|
|
|
|
|
|
and then "make" again to confirm
|
|
|
|
*/
|
|
|
|
|
2023-12-18 07:30:53 +00:00
|
|
|
typedef short return_t;
|
|
|
|
#error /* produce an error */
|
|
|
|
|
|
|
|
return_t main(int argc, char* argv[])
|
2022-11-03 16:40:13 +00:00
|
|
|
{
|
2022-10-22 04:45:51 +00:00
|
|
|
printf("%02x", 0x42); /* produce an error */
|
|
|
|
n = 0; /* produce an error */
|
|
|
|
/* produce a warning */
|
2022-11-03 16:40:13 +00:00
|
|
|
}
|