34 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -fms-extensions -verify %s2// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsyntax-only -fms-extensions -verify %s -DMSVC3 4// Export const variable initialization.5 6#ifdef MSVC7// expected-no-diagnostics8#endif9 10#ifndef MSVC11// expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}12#endif13__declspec(dllexport) int const x = 3;14 15namespace {16namespace named {17#ifndef MSVC18// expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}19#endif20__declspec(dllexport) int const x = 3;21}22} // namespace23 24namespace named1 {25namespace {26namespace named {27#ifndef MSVC28// expected-warning@+2 {{__declspec attribute 'dllexport' is not supported}}29#endif30__declspec(dllexport) int const x = 3;31}32} // namespace33} // namespace named134