teak-llvm/clang/test/CodeGen/flatten.c
Peter Collingbourne 41af7c2fdc Implement the flatten attribute.
This is a GNU attribute that causes calls within the attributed function
to be inlined where possible. It is implemented by giving such calls the
alwaysinline attribute.

Differential Revision: http://reviews.llvm.org/D3816

llvm-svn: 209217
2014-05-20 17:12:51 +00:00

20 lines
335 B
C

// RUN: %clang_cc1 -triple=x86_64-linux-gnu %s -emit-llvm -o - | FileCheck %s
void f(void) {}
__attribute__((noinline)) void ni(void) {}
__attribute__((flatten))
// CHECK: define void @g()
void g(void) {
// CHECK-NOT: call {{.*}} @f
f();
// CHECK: call {{.*}} @ni
ni();
}
void h(void) {
// CHECK: call {{.*}} @f
f();
}