Is an empty function called at all in optimised code?

Viewed 6681

If the TEST macro is not defined, I would like to know whether there is a performance difference in these two pieces of code:

void Func1(int a) {
   // ...
}

#ifdef TEST
Func1(123);
#endif

and:

void Func2(int a) {
#ifdef TEST
    // ...
#endif
}

Func2(123);

With TEST not defined, Func2 would become an empty function that the compiler should not call at all, isn't it?

2 Answers
Related