Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / bolt / test / X86 / Inputs / inlined.cpp
bloba6ff9e262a4b85f43d28971b29b847eb96e4a296
1 extern "C" int printf(const char*, ...);
2 extern const char* question();
4 inline int answer() __attribute__((always_inline));
5 inline int answer() { return 42; }
7 int main(int argc, char *argv[]) {
8 int ans;
9 if (argc == 1) {
10 ans = 0;
11 } else {
12 ans = argc;
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;
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;