dg-finalThe GCC testsuite defines the following directives to be used within
dg-final.
scan-file filename regexp [{ target/xfail selector }]scan-file-not filename regexp [{ target/xfail selector }]scan-module module regexp [{ target/xfail selector }]scan-assembler regex [{ target/xfail selector }]scan-assembler-not regex [{ target/xfail selector }]scan-assembler-times regex num [{ target/xfail selector }]scan-assembler-dem regex [{ target/xfail selector }]scan-assembler-dem-not regex [{ target/xfail selector }]scan-hidden symbol [{ target/xfail selector }]scan-not-hidden symbol [{ target/xfail selector }]These commands are available for kind of tree, rtl,
and ipa.
scan-kind-dump regex suffix [{ target/xfail selector }]scan-kind-dump-not regex suffix [{ target/xfail selector }]scan-kind-dump-times regex num suffix [{ target/xfail selector }]scan-kind-dump-dem regex suffix [{ target/xfail selector }]scan-kind-dump-dem-not regex suffix [{ target/xfail selector }]output-exists [{ target/xfail selector }]output-exists-not [{ target/xfail selector }]scan-symbol regexp [{ target/xfail selector }]run-gcov sourcefilerun-gcov [branches] [calls] { opts sourcefile }Usually the test-framework removes files that were generated during testing. If a testcase, for example, uses any dumping mechanism to inspect a passes dump file, the testsuite recognized the dump option passed to the tool and schedules a final cleanup to remove these files.
There are, however, following additional cleanup directives that can be used to annotate a testcase "manually".
cleanup-coverage-filescleanup-modules "list-of-extra-modules" module MoD1
end module MoD1
module Mod2
end module Mod2
module moD3
end module moD3
module mod4
end module mod4
! { dg-final { cleanup-modules "mod1 mod2" } } ! redundant
! { dg-final { keep-modules "mod3 mod4" } }
keep-modules "list-of-modules-not-to-delete" module maybe_unneeded
end module maybe_unneeded
module keep1
end module keep1
module keep2
end module keep2
! { dg-final { keep-modules "keep1 keep2" } } ! just keep these two
! { dg-final { keep-modules "" } } ! keep all
dg-keep-saved-temps "list-of-suffixes-not-to-delete" // { dg-options "-save-temps -fpch-preprocess -I." }
int main() { return 0; }
// { dg-keep-saved-temps ".s" } ! just keep assembler file
// { dg-keep-saved-temps ".s" ".i" } ! ... and .i
// { dg-keep-saved-temps ".ii" ".o" } ! or just .ii and .o
cleanup-profile-filecleanup-repo-files