Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / SemaCXX / using-declspec.cpp
blobf4cc8d3736ca49b398343fb8f4f1fbbeba85497e
1 // RUN: %clang_cc1 -fms-compatibility -fsyntax-only -verify %s
3 // This should ignore the alignment and issue a warning about
4 // align not being used
5 auto func() -> __declspec(align(16)) int; // expected-warning{{attribute ignored when parsing type}}
6 static_assert(alignof(decltype(func())) == alignof(int), "error");
8 // The following should NOT assert since alignment should
9 // follow the type
10 struct Test { int a; };
11 using AlignedTest = __declspec(align(16)) const Test;
12 static_assert(alignof(AlignedTest) == 16, "error");
14 // Same here, no declaration to shift to
15 int i = (__declspec(align(16))int)12; // expected-warning{{attribute ignored when parsing type}}
17 // But there is a declaration here!
18 typedef __declspec(align(16)) int Foo;
19 static_assert(alignof(Foo) == 16, "error");