Clang Project

clang_source_code/test/Sema/dllexport-1.cpp
1// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -fms-extensions -verify %s
2// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsyntax-only -fms-extensions -verify %s  -DMSVC
3
4// Export const variable initialization.
5
6#ifdef MSVC
7// expected-no-diagnostics
8#endif
9
10#ifndef MSVC
11// expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}
12#endif
13__declspec(dllexport) int const x = 3;
14
15namespace {
16namespace named {
17#ifndef MSVC
18// expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}
19#endif
20__declspec(dllexport) int const x = 3;
21}
22} // namespace
23
24namespace named1 {
25namespace {
26namespace named {
27#ifndef MSVC
28// expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}
29#endif
30__declspec(dllexport) int const x = 3;
31}
32} // namespace
33} // namespace named1
34