136
edits
No edit summary |
No edit summary |
||
Line 19: | Line 19: | ||
|- | |- | ||
|<syntaxhighlight lang="c"> | |<syntaxhighlight lang="c"> | ||
// The following code tests ConstPropagation applied to main function. | |||
// In the given example, variables a, b and c are known. | |||
// They are propagated to the rest of the body of main. | |||
#pragma EMX_TRANSFORMATION ConstPropagation | #pragma EMX_TRANSFORMATION ConstPropagation | ||
int main(void) { | int main(void) { | ||
Line 31: | Line 34: | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|< | |<syntaxhighlight lang="c"> | ||
// The following code is the generated code after the transformation has been applied. | |||
int main(void) { | |||
int a = 2; | int a = 2; | ||
int b = a; | int b = a; | ||
Line 40: | Line 46: | ||
return 0; | return 0; | ||
} | } | ||
</ | </syntaxhighlight> | ||
|- | |- | ||
| | | |
edits