1extern "C" int printf(const char*, ...);
2extern const char* question();
3
4inline int answer() __attribute__((always_inline));
5inline int answer() { return 42; }
6
7int main(int argc, char *argv[]) {
8 int ans;
9 if (argc == 1) {
10 ans = 0;
11 } else {
12 ans = argc;
13 }
14 printf("%s\n", question());
15 for (int i = 0; i < 10; ++i) {
16 int x = answer();
17 int y = answer();
18 ans += x - y;
19 }
20 // padding to make sure question() is inlineable
21 asm("nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;");
22 return ans;
23}
24

source code of bolt/test/X86/Inputs/inlined.cpp