// RUN: %clang_cc1 -emit-llvm -triple i686-pc-win32 -fms-extensions -verify -o - %s | FileCheck %s
// expected-no-diagnostics
// Simple case
int __declspec
//CHECK: define {{.*}}bar_one{{.*}} section "foo_one"
// Simple case - explicit attribute used over pragma
int __declspec
//CHECK: define {{.*}}bar2{{.*}} section "foo_three"
// Check that attribute on one function doesn't affect another
int
//CHECK: define {{.*}}another1{{.*}} section "foo_two"
// Member functions
;
;
int
//CHECK: define {{.*}}bar3@Foo{{.*}} section "foo_four"
int
//CHECK: define {{.*}}bar4@Foo{{.*}} section "foo_four"
int
// MS Compiler and Docs do not match for nested routines
// Doc says: define {{.*}}bar5@Inner@Foo{{.*}} section "foo_four"
// Compiler says: define {{.*}}bar5@Inner@Foo{{.*}} section "foo_two"
// A bug has been reported: see https://reviews.llvm.org/D22931, the
// Microsoft feedback page is no longer available.
//CHECK: define {{.*}}bar5@Inner@Foo{{.*}} section "foo_two"
//CHECK: define {{.*}}bar6@Foo{{.*}} section "foo_six"
//CHECK: define {{.*}}bar7@Foo{{.*}} section "foo_four"
// Check that code_seg active at class declaration is not used on member
// declared outside class when it is not active.
;
int
int
//CHECK: define {{.*}}bar8@FooThree{{.*}} section "someother"
//CHECK: define {{.*}}bar9@FooThree{{.*}} section "AnotherSeg"
;
// check the section for compiler-generated function with declspec.
;
//CHECK: define {{.*}}0FooFour@@QAE@ABU0@@Z{{.*}} section "foo_seven"
// check the section for compiler-generated function with no declspec.
;
//CHECK: define {{.*}}0FooFive@@QAE@ABU0@@Z{{.*}} section "someother"
int
//CHECK: define {{.*}}bar10@FooFour{{.*}} section "foo_eight"
//CHECK: define {{.*}}bar11@FooFive{{.*}} section "foo_nine"
;
int
//CHECK: define {{.*}}bar14{{.*}} section "foo_eleven"
int
//CHECK: define {{.*}}bar12@FooSix{{.*}} section "foo_ten"
//CHECK: define {{.*}}bar13@FooSix{{.*}} section "foo_eleven"
//CHECK: define {{.*}}baz1@FooTwo{{.*}} section "foo_four"