Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
      2 
      3 // Ensure that we don't emit available_externally functions at -O0.
      4 int x;
      5 
      6 inline void f0(int y) { x = y; }
      7 
      8 // CHECK-LABEL: define void @test()
      9 // CHECK: declare void @f0(i32)
     10 void test() {
     11   f0(17);
     12 }
     13 
     14 inline int __attribute__((always_inline)) f1(int x) {
     15   int blarg = 0;
     16   for (int i = 0; i < x; ++i)
     17     blarg = blarg + x * i;
     18   return blarg;
     19 }
     20 
     21 // CHECK: @test1
     22 int test1(int x) {
     23   // CHECK: br i1
     24   // CHECK-NOT: call {{.*}} @f1
     25   // CHECK: ret i32
     26   return f1(x);
     27 }
     28