blob: 747d3cd35755c75237d725b03355dc31bf53452d [file] [log] [blame]
Douglas Gregor44eac332010-07-13 06:02:28 +00001// RUN: %clang_cc1 -emit-llvm -o - -O0 -triple x86_64-apple-darwin10 %s | FileCheck %s
2
3// Ensure that we don't emit available_externally functions at -O0.
4int x;
5
6inline void f0(int y) { x = y; }
7
8// CHECK: define void @test()
9// CHECK: declare void @f0(i32)
10void test() {
11 f0(17);
12}
Douglas Gregor7feaeee2010-07-15 22:58:18 +000013
14inline 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
Douglas Gregor1ce377a2010-07-15 23:04:05 +000021// CHECK: @test1
Douglas Gregor7feaeee2010-07-15 22:58:18 +000022int test1(int x) {
23 // CHECK: br i1
24 // CHECK-NOT: call
25 // CHECK: ret i32
26 return f1(x);
27}