2013-09-04 12:12:25 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
|
2010-07-13 14:02:28 +08:00
|
|
|
|
|
|
|
// Ensure that we don't emit available_externally functions at -O0.
|
|
|
|
int x;
|
|
|
|
|
|
|
|
inline void f0(int y) { x = y; }
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @test()
|
2010-07-13 14:02:28 +08:00
|
|
|
// CHECK: declare void @f0(i32)
|
|
|
|
void test() {
|
|
|
|
f0(17);
|
|
|
|
}
|
2010-07-16 06:58:18 +08:00
|
|
|
|
2011-05-22 14:50:05 +08:00
|
|
|
inline int __attribute__((always_inline)) f1(int x) {
|
2010-07-16 06:58:18 +08:00
|
|
|
int blarg = 0;
|
|
|
|
for (int i = 0; i < x; ++i)
|
|
|
|
blarg = blarg + x * i;
|
2011-05-22 14:50:05 +08:00
|
|
|
return blarg;
|
2010-07-16 06:58:18 +08:00
|
|
|
}
|
|
|
|
|
2010-07-16 07:04:05 +08:00
|
|
|
// CHECK: @test1
|
2011-05-22 14:50:05 +08:00
|
|
|
int test1(int x) {
|
2010-07-16 06:58:18 +08:00
|
|
|
// CHECK: br i1
|
2011-05-22 14:50:05 +08:00
|
|
|
// CHECK-NOT: call {{.*}} @f1
|
2010-07-16 06:58:18 +08:00
|
|
|
// CHECK: ret i32
|
2011-05-22 14:50:05 +08:00
|
|
|
return f1(x);
|
2010-07-16 06:58:18 +08:00
|
|
|
}
|