// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple x86_64-apple-darwin10 %s | FileCheck %s

// Ensure that we don't emit available_externally functions at -O0.
int x;

inline void f0(int y) { x = y; }

// CHECK: define void @test()
// CHECK: declare void @f0(i32)
void test() {
  f0(17);
}

inline int __attribute__((always_inline)) f1(int x) { 
  int blarg = 0;
  for (int i = 0; i < x; ++i)
    blarg = blarg + x * i;
  return blarg; 
}

int test1(int x) { 
  // CHECK: br i1
  // CHECK-NOT: call
  // CHECK: ret i32
  return f1(x); 
}

// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple x86_64-apple-darwin10 %s | FileCheck %s

// Ensure that we don't emit available_externally functions at -O0.
int x;

inline void f0(int y) { x = y; }

// CHECK: define void @test()
// CHECK: declare void @f0(i32)
void test() {
  f0(17);
}

inline int __attribute__((always_inline)) f1(int x) { 
  int blarg = 0;
  for (int i = 0; i < x; ++i)
    blarg = blarg + x * i;
  return blarg; 
}

// CHECK: @test1
int test1(int x) { 
  // CHECK: br i1
  // CHECK-NOT: call
  // CHECK: ret i32
  return f1(x); 
}

Improve test case. Thanks Eli
Improve test case. Thanks Eli

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@108470 91177308-0d34-0410-b5e6-96231b3b80d8
