// RUN: %clang_cc1 -emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
// RUN: %clang_cc1 -O2 -fno-inline -emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s
// RUN: %clang_cc1 -flto -O2 -fno-inline -emit-llvm -o - -triple x86_64-apple-darwin10 %s | FileCheck %s -check-prefix=LTO
// Ensure that we don't emit available_externally functions at -O0.
// Also should not emit them at -O2, unless -flto is present in which case
// we should preserve them for link-time inlining decisions.
int x;
inline void
// CHECK-LABEL: define{{.*}} void @test()
// CHECK: declare void @f0(i32 noundef)
// LTO-LABEL: define{{.*}} void @test()
// LTO: define available_externally void @f0
void
inline int
// CHECK: @test1
// LTO: @test1
int