I am working on Cortex M0. CCS under usage is 5.3.0.00090 and library is rtsv6M0_T_le_eabi.lib. Simulator under usage is "Cortex-M3 Device Cycle Accurate Simulator, Little Endian"
I wanted to use inline function so I defined inline function "inline int max(int a, int b) { return a > b ? a : b;}" in sample.h file and main function calling that inline function as below:
#include "sample.h"
void main(void)
{ int x;
x = max(2,5);
while(1) { x = max(8,9); x = max(7,2);}
}
Using above mentioned simulator, debug it however in simulator it goes inside that inline function similar to other non-inline function. So while CPU clock calculation it shows entry and exit function cycles whereas my expectation is that it should replace that inline function with code defined inside that inline function.
I set size of auto inline as non zero --auto_inline=20 however not any change in its behaviour. Please Note: Optimizations are not used so -Ooff --opt_for_speed=0.
Please let me know whether I need to set any other flags to enable inline function features.
Thanks in advance.