// RUN: %clang_cc1 < %s -triple i386-mingw32 -fms-extensions -emit-llvm -x c++ | FileCheck %s
// optnone wins over inlinehint.
// Test that both func1 and func2 are marked optnone and noinline.
// Definition with both optnone and inlinehint.
inline int
// CHECK: @_Z5func1i({{.*}}) [[OPTNONE:#[0-9]+]]
// optnone declaration, inlinehint definition.
int ;
inline int
// CHECK: @_Z5func2i({{.*}}) [[OPTNONE]]
// Keep alive the definitions of func1 and func2.
int
// optnone wins over minsize.
int ;
int
// Same attribute set as everything else, therefore no 'minsize'.
// CHECK: @_Z5func3i({{.*}}) [[OPTNONE]]
// Verify that noreturn is compatible with optnone.
extern void ;
extern void
// CHECK: @_Z17noreturn_functioni({{.*}}) [[NORETURN:#[0-9]+]]
// Verify that __declspec(noinline) is compatible with optnone.
__declspec
void
// CHECK: @_Z5func4v() [[OPTNONE]]
__declspec
extern void ;
void
// CHECK: @_Z5func5v() [[OPTNONE]]
// Verify also that optnone can be used on dllexport functions.
// Adding attribute optnone on a dllimport function has no effect.
int ;
int
// CHECK: @_Z21exported_optnone_funci({{.*}}) [[OPTNONE]]
// CHECK: declare dllimport {{.*}} @_Z21imported_optnone_funci({{.*}}) [[DLLIMPORT:#[0-9]+]]
// CHECK: attributes [[OPTNONE]] = { mustprogress noinline {{.*}} optnone
// CHECK: attributes [[NORETURN]] = { mustprogress noinline noreturn {{.*}} optnone
// CHECK: attributes [[DLLIMPORT]] =
// CHECK-NOT: optnone