[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.4.12 Callable Code -callable <boolean>
-callable <boolean>
: if boolean=1
, then a test
function will be generated that has the parameters as arguments.
Similarly to the -compilable
option,
a macro for each statement is generated. The generated definitions of
these macros are as used during the correctness testing, but they
can easily be changed by the user to suit her own needs.
This option is only available if the target language is C.
The default value is 0.
/* Generated from double.cloog with option -callable 0 */ for (i=0;i<=M;i++) { S1 ; for (j=0;j<=N;j++) { S2 ; S3 ; } S4 ; }
/* Generated from double.cloog with option -callable 1 */ extern void hash(int); /* Useful macros. */ #define floord(n,d) (((n)<0) ? ((n)-(d)+1)/(d) : (n)/(d)) #define ceild(n,d) (((n)<0) ? (n)/(d) : ((n)+(d)+1)/(d)) #define max(x,y) ((x) > (y) ? (x) : (y)) #define min(x,y) ((x) < (y) ? (x) : (y)) #define S1(i) { hash(1); hash(i); } #define S2(i,j) { hash(2); hash(i); hash(j); } #define S3(i,j) { hash(3); hash(i); hash(j); } #define S4(i) { hash(4); hash(i); } void test(int M, int N) { /* Original iterators. */ int i, j; for (i=0;i<=M;i++) { S1(i) ; for (j=0;j<=N;j++) { S2(i,j) ; S3(i,j) ; } S4(i) ; } }
This document was generated on August 20, 2013 using texi2html 5.0.