[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / Sema / dllexport-1.cpp
blob6180d3566993df0d78f5fcd0d26e8c6382cf20b4
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
4 // Export const variable initialization.
6 #ifdef MSVC
7 // expected-no-diagnostics
8 #endif
10 #ifndef MSVC
11 // expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}
12 #endif
13 __declspec(dllexport) int const x = 3;
15 namespace {
16 namespace named {
17 #ifndef MSVC
18 // expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}
19 #endif
20 __declspec(dllexport) int const x = 3;
22 } // namespace
24 namespace named1 {
25 namespace {
26 namespace named {
27 #ifndef MSVC
28 // expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}
29 #endif
30 __declspec(dllexport) int const x = 3;
32 } // namespace
33 } // namespace named1