gccint: RTL Tests

1 
1 7.11 Support for testing RTL passes
1 ===================================
1 
1 As of gcc 7, C functions can be tagged with '__RTL' to indicate that the
1 function body will be RTL, rather than C. For example:
1 
1      double __RTL (startwith ("ira")) test (struct foo *f, const struct bar *b)
1      {
1        (function "test"
1           [...snip; various directives go in here...]
1        ) ;; function "test"
1      }
1 
1  The 'startwith' argument indicates at which pass to begin.
1 
1  The parser expects the RTL body to be in the format emitted by this
1 dumping function:
1 
1      DEBUG_FUNCTION void
1      print_rtx_function (FILE *outfile, function *fn, bool compact);
1 
1  when "compact" is true.  So you can capture RTL in the correct format
1 from the debugger using:
1 
1      (gdb) print_rtx_function (stderr, cfun, true);
1 
1  and copy and paste the output into the body of the C function.
1 
1  Example DejaGnu tests of RTL can be seen in the source tree under
1 'gcc/testsuite/gcc.dg/rtl'.
1 
1  The '__RTL' parser is not integrated with the C tokenizer or
1 preprocessor, and works simply by reading the relevant lines within the
1 braces.  In particular, the RTL body must be on separate lines from the
1 enclosing braces, and the preprocessor is not usable within it.
1