1 // RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify %s
6 struct SeparateCacheLines
{
8 } __attribute__((aligned(256)));
10 SeparateCacheLines
<int> high_contention_data
[10];
15 new Test
; // expected-warning {{type 'test1::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
16 new Test
[10]; // expected-warning {{type 'test1::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
22 typedef int __attribute__((aligned(256))) aligned_int
;
23 aligned_int high_contention_data
[10];
28 new Test
; // expected-warning {{type 'test2::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
29 new Test
[10]; // expected-warning {{type 'test2::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
36 struct SeparateCacheLines
{
38 } __attribute__((aligned(256)));
40 void* operator new(unsigned long) {
41 return 0; // expected-warning {{'operator new' should not return a null pointer unless it is declared 'throw()'}}
44 SeparateCacheLines
<int> high_contention_data
[10];
50 new Test
[10]; // expected-warning {{type 'test3::Test' requires 256 bytes of alignment and the default allocator only guarantees}}
57 struct SeparateCacheLines
{
59 } __attribute__((aligned(256)));
61 void* operator new[](unsigned long) {
62 return 0; // expected-warning {{'operator new[]' should not return a null pointer unless it is declared 'throw()'}}
65 SeparateCacheLines
<int> high_contention_data
[10];
70 new Test
; // expected-warning {{type 'test4::Test' requires 256 bytes of alignment and the default allocator only guarantees}}