@@ -448,7 +448,7 @@ even run the resulting program. Just add one of the following
448
448
- ` //@ build-pass ` — compilation and linking should succeed but do
449
449
not run the resulting binary.
450
450
- ` //@ run-pass ` — compilation should succeed and running the resulting
451
- binary should also succeed .
451
+ binary should make it exit with code 0 which indicates success .
452
452
- Fail directives:
453
453
- ` //@ check-fail ` — compilation should fail (the codegen phase is skipped).
454
454
This is the default for UI tests.
@@ -457,10 +457,20 @@ even run the resulting program. Just add one of the following
457
457
- First time is to ensure that the compile succeeds without the codegen phase
458
458
- Second time is to ensure that the full compile fails
459
459
- ` //@ run-fail ` — compilation should succeed, but running the resulting
460
- binary should fail.
461
-
462
- For ` run-pass ` and ` run-fail ` tests, by default the output of the program itself
463
- is not checked.
460
+ binary should make it exit with a code in the range ` 1..=127 ` which
461
+ indicates regular failure. On targets without unwind support, crashes
462
+ are also accepted.
463
+ - ` //@ run-crash ` — compilation should succeed, but running the resulting
464
+ binary should fail with a crash. Crashing is defined as "not exiting with
465
+ a code in the range ` 0..=127 ` ". Example on Linux: Termination by ` SIGABRT `
466
+ or ` SIGSEGV ` . Example on Windows: Exiting with the code for
467
+ ` STATUS_ILLEGAL_INSTRUCTION ` (` 0xC000001D ` ).
468
+ - ` //@ run-fail-or-crash ` — compilation should succeed, but running the
469
+ resulting binary should either ` run-fail ` or ` run-crash ` . Useful if a test
470
+ crashes on some targets but just fails on others.
471
+
472
+ For ` run-pass ` . ` run-fail ` , ` run-crash ` and ` run-fail-or-crash ` tests, by
473
+ default the output of the program itself is not checked.
464
474
465
475
If you want to check the output of running the program, include the
466
476
` check-run-results ` directive. This will check for a ` .run.stderr ` and
0 commit comments