Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Testsuites   [Contents][Index]


6.10 Support for testing GIMPLE passes

As of gcc 7, C functions can be tagged with__GIMPLE to indicatethat the function body will be GIMPLE, rather than C. The compiler requiresthe option-fgimple to enable this functionality. For example:

/* { dg-do compile } *//* { dg-options "-O -fgimple" } */void __GIMPLE (startwith ("dse2")) foo (){  int a;bb_2:  if (a > 4)    goto bb_3;  else    goto bb_4;bb_3:  a_2 = 10;  goto bb_5;bb_4:  a_3 = 20;bb_5:  a_1 = __PHI (bb_3: a_2, bb_4: a_3);  a_4 = a_1 + 4;  return;}

Thestartwith argument indicates at which pass to begin.

Use the dump modifier-gimple (e.g.-fdump-tree-all-gimple)to make tree dumps more closely follow the format accepted by the GIMPLEparser.

Example DejaGnu tests of GIMPLE can be seen in the source tree atgcc/testsuite/gcc.dg/gimplefe-*.c.

The__GIMPLE parser is integrated with the C tokenizer andpreprocessor, so it should be possible to use macros to build outtest coverage.


[8]ページ先頭

©2009-2026 Movatter.jp