1 // RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify=precxx17 %std_cxx98-14 %s
2 // RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify=cxx17 %std_cxx17- %s
7 struct SeparateCacheLines
{
9 } __attribute__((aligned(256)));
11 SeparateCacheLines
<int> high_contention_data
[10];
16 new Test
; // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
17 new Test
[10]; // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
27 typedef S
__attribute__((aligned(256))) alignedS
;
28 alignedS high_contention_data
[10];
33 new Test
; // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
34 new Test
[10]; // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
41 struct SeparateCacheLines
{
43 } __attribute__((aligned(256)));
45 void* operator new(unsigned long) {
46 return 0; // precxx17-warning {{'operator new' should not return a null pointer unless it is declared 'throw()'}} \
47 cxx17
-warning
{{'operator new' should
not return a null pointer unless it is declared
'throw()' or 'noexcept'}}
50 SeparateCacheLines
<int> high_contention_data
[10];
56 new Test
[10]; // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}
63 struct SeparateCacheLines
{
65 } __attribute__((aligned(256)));
67 void* operator new[](unsigned long) {
68 return 0; // precxx17-warning {{'operator new[]' should not return a null pointer unless it is declared 'throw()'}} \
69 cxx17
-warning
{{'operator new[]' should
not return a null pointer unless it is declared
'throw()' or 'noexcept'}}
72 SeparateCacheLines
<int> high_contention_data
[10];
77 new Test
; // precxx17-warning {{type 'Test' requires 256 bytes of alignment and the default allocator only guarantees}}