Calling a function declared with static attribute((always_inline)) from within the interpreter will only work once. Subsequent attempts will result in an ‘undefined symbol’ error from IncrementalExecutor::executeFunction. Though it is still defined if called from another function (I’m assuming because it was actually inlined).
[code]/*
- bin/cling -DTESTDECL=“inline”
- bin/cling -DTESTDECL=“attribute((always_inline))”
- bin/cling -DTESTDECL=“static attribute((always_inline))”
#include "test.h"
TESTgetValue();
TESTgetValue(); // 3. Fails (unresolved symbol)
#include "test.h"
test();
test();
TESTgetValue(); // 3. fails
test(); // Still works
#include "test.h"
TESTgetValue();
test(); // 3 fails
*/
#include <stdio.h>
TESTDECL void TESTgetValue()
{
printf(“A\n”);
}
static void test() {
TESTgetValue();
TESTgetValue();
}[/code]