// RUN: %clang_cc1 -emit-llvm -triple i686-pc-win32 -fms-extensions -verify -o - %s | FileCheck %s
// expected-no-diagnostics
// The Microsoft document says: "When this attribute is applied to a class,
// all member functions of the class and nested classes - this includes
// compiler-generated special member functions - are put in the specified segment."
// But the MS compiler does not always follow that. A bug has been reported:
// see https://reviews.llvm.org/D22931, the Microsoft feedback page is no
// longer available.
// The MS compiler will apply a declspec from the parent class if there is no
// #pragma code_seg active at the class definition. If there is an active
// code_seg that is used instead.
// No active code_seg
;
void
void
//CHECK: define {{.*}}bar1@Inner@Foo1{{.*}} section "foo_outer"
//CHECK: define {{.*}}bar2@Inner@Foo1{{.*}} section "foo_outer"
;
void
void
//CHECK: define {{.*}}bar1@Inner@Foo2{{.*}} section "foo_inner"
//CHECK: define {{.*}}bar2@Inner@Foo2{{.*}} section "foo_inner"
;
void
void
//CHECK: define {{.*}}bar1@Inner@Foo3{{.*}} section "otherseg"
//CHECK: define {{.*}}bar2@Inner@Foo3{{.*}} section "otherseg"
;
void
void
//CHECK: define {{.*}}bar1@Inner@Foo4{{.*}} section "foo_inner"
//CHECK: define {{.*}}bar2@Inner@Foo4{{.*}} section "foo_inner"
// Back to no active pragma
;
void
void
void
void
//CHECK: define {{.*}}bar1@Inner@Foo5{{.*}} section "foo_outer"
//CHECK: define {{.*}}bar2@Inner@Foo5{{.*}} section "foo_outer"
//CHECK: define {{.*}}bar1@Inner2@Inner1@Inner@Foo5{{.*}} section "inner1_seg"
//CHECK: define {{.*}}bar2@Inner2@Inner1@Inner@Foo5{{.*}} section "inner1_seg"