brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.2 KiB · 21e30e5 Raw
47 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -fms-extensions -Wno-ignored-attributes -verify %s2 3struct [[]] __attribute__((lockable)) __declspec(dllexport) A {}; // ok4struct [[]] __declspec(dllexport) __attribute__((lockable)) B {}; // ok5struct [[]] [[]] __declspec(dllexport) __attribute__((lockable)) C {}; // ok6struct __declspec(dllexport) [[]] __attribute__((lockable)) D {}; // ok7struct __declspec(dllexport) __attribute__((lockable)) [[]] E {}; // ok8struct __attribute__((lockable)) __declspec(dllexport) [[]] F {}; // ok9struct __attribute__((lockable)) [[]] __declspec(dllexport) G {}; // ok10struct [[]] __attribute__((lockable)) [[]] __declspec(dllexport) H {}; // ok11 12[[noreturn]] __attribute__((cdecl)) __declspec(dllexport) void a(); // ok13[[noreturn]] __declspec(dllexport) __attribute__((cdecl)) void b(); // ok14[[]] [[noreturn]] __attribute__((cdecl)) __declspec(dllexport) void c(); // ok15 16__declspec(dllexport) [[noreturn]] __attribute__((cdecl)) void d(); // expected-error {{an attribute list cannot appear here}}17__declspec(dllexport) __attribute__((cdecl)) [[noreturn]] void e(); // expected-error {{an attribute list cannot appear here}}18__attribute__((cdecl)) __declspec(dllexport) [[noreturn]] void f(); // expected-error {{an attribute list cannot appear here}}19 20__attribute__((cdecl)) [[noreturn]] __declspec(dllexport) void g(); // ok21 22[[noreturn]] __attribute__((cdecl))23[[]]24__declspec(dllexport) void h();25 26template <int a>27__attribute__((cdecl)) [[noreturn]] __declspec(dllexport) void i(); // ok28 29template <int a>30[[]] [[noreturn]] __attribute__((cdecl)) __declspec(dllexport) void j(); // ok31 32template <int a>33[[noreturn]] __declspec(dllexport) __attribute__((cdecl)) void k(); // ok34 35extern "C" {36  __attribute__ ((__warn_unused_result__)) [[__maybe_unused__]] int l(int); // ok37  [[__maybe_unused__]] __attribute__ ((__warn_unused_result__)) int m(int); // ok38}39 40extern "C" {41  __attribute__ ((__warn_unused_result__)) [[__maybe_unused__]] int n (int); // ok42  __attribute__ ((__warn_unused_result__)) [[__maybe_unused__]] static int o (int x) { return x; }; // ok43}44 45extern "C" __attribute__ ((__warn_unused_result__)) [[__maybe_unused__]] int p(int); // ok46extern "C" [[__maybe_unused__]] __attribute__ ((__warn_unused_result__)) int q(int); // ok47