1 // RUN: %clang_cc1 -fsyntax-only -fms-extensions -Wno-ignored-attributes -verify %s
2 
3 struct [[]] __attribute__((lockable)) __declspec(dllexport) A {}; // ok
4 struct [[]] __declspec(dllexport) __attribute__((lockable)) B {}; // ok
5 struct [[]] [[]] __declspec(dllexport) __attribute__((lockable)) C {}; // ok
6 struct __declspec(dllexport) [[]] __attribute__((lockable)) D {}; // ok
7 struct __declspec(dllexport) __attribute__((lockable)) [[]] E {}; // ok
8 struct __attribute__((lockable)) __declspec(dllexport) [[]] F {}; // ok
9 struct __attribute__((lockable)) [[]] __declspec(dllexport) G {}; // ok
10 struct [[]] __attribute__((lockable)) [[]] __declspec(dllexport) H {}; // ok
11 
12 [[noreturn]] __attribute__((cdecl)) __declspec(dllexport) void a(); // ok
13 [[noreturn]] __declspec(dllexport) __attribute__((cdecl)) void b(); // ok
14 [[]] [[noreturn]] __attribute__((cdecl)) __declspec(dllexport) void c(); // ok
15 
16 // [[]] attributes before a declaration must be at the start of the line.
17 __declspec(dllexport) [[noreturn]] __attribute__((cdecl)) void d(); // expected-error {{an attribute list cannot appear here}}
18 __declspec(dllexport) __attribute__((cdecl)) [[noreturn]] void e(); // expected-error {{an attribute list cannot appear here}}
19 __attribute__((cdecl)) __declspec(dllexport) [[noreturn]] void f(); // expected-error {{an attribute list cannot appear here}}
20 __attribute__((cdecl)) [[noreturn]] __declspec(dllexport) void g(); // expected-error {{an attribute list cannot appear here}}
21 
22 [[noreturn]] __attribute__((cdecl))
23 [[]] // expected-error {{an attribute list cannot appear here}}
24 __declspec(dllexport) void h();
25