Nick Lewycky | 32d4abf | 2012-01-24 21:28:47 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -triple=x86_64-pc-linux-gnu -Wover-aligned -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Nick Lewycky | fca84b2 | 2012-01-24 21:15:41 +0000 | [diff] [blame] | 3 | |
| 4 | // This test verifies that we don't warn when the global operator new is |
| 5 | // overridden. That's why we can't merge this with the other test file. |
| 6 | |
| 7 | void* operator new(unsigned long); |
| 8 | void* operator new[](unsigned long); |
| 9 | |
| 10 | struct Test { |
| 11 | template <typename T> |
| 12 | struct SeparateCacheLines { |
| 13 | T data; |
| 14 | } __attribute__((aligned(256))); |
| 15 | |
| 16 | SeparateCacheLines<int> high_contention_data[10]; |
| 17 | }; |
| 18 | |
| 19 | void helper() { |
| 20 | Test t; |
| 21 | new Test; |
| 22 | new Test[10]; |
| 23 | } |