xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/always_inline.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang -emit-llvm -S -o %t %s
2*f4a2713aSLionel Sambuc // RUN: not grep '@f0' %t
3*f4a2713aSLionel Sambuc // RUN: not grep 'call ' %t
4*f4a2713aSLionel Sambuc // RUN: %clang -mllvm -disable-llvm-optzns -emit-llvm -S -o %t %s
5*f4a2713aSLionel Sambuc // RUN: grep '@f0' %t | count 2
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc //static int f0() {
f0()8*f4a2713aSLionel Sambuc static int __attribute__((always_inline)) f0() {
9*f4a2713aSLionel Sambuc   return 1;
10*f4a2713aSLionel Sambuc }
11*f4a2713aSLionel Sambuc 
f1()12*f4a2713aSLionel Sambuc int f1() {
13*f4a2713aSLionel Sambuc   return f0();
14*f4a2713aSLionel Sambuc }
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc // PR4372
17*f4a2713aSLionel Sambuc inline int f2() __attribute__((always_inline));
f2()18*f4a2713aSLionel Sambuc int f2() { return 7; }
f3(void)19*f4a2713aSLionel Sambuc int f3(void) { return f2(); }
20*f4a2713aSLionel Sambuc 
21