summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/builtin-assume-aligned.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix test failure with 374562 on HexagonErich Keane2019-10-111-1/+1
| | | | | | | | | __builtin_assume_aligned takes a size_t which is a 32 bit int on hexagon. Thus, the constant gets converted to a 32 bit value, resulting in 0 not being a power of 2. This patch changes the constant being passed to 2**30 so that it fails, but doesnt exceed 30 bits. llvm-svn: 374569
* Reland r374450 with Richard Smith's comments and test fixed.Erich Keane2019-10-111-0/+4
| | | | | | | | | | The behavior from the original patch has changed, since we're no longer allowing LLVM to just ignore the alignment. Instead, we're just assuming the maximum possible alignment. Differential Revision: https://reviews.llvm.org/D68824 llvm-svn: 374562
* Revert 374450 "Fix __builtin_assume_aligned with too large values."Nico Weber2019-10-101-4/+0
| | | | | | | | | | | | | The test fails on Windows, with error: 'warning' diagnostics expected but not seen: File builtin-assume-aligned.c Line 62: requested alignment must be 268435456 bytes or smaller; assumption ignored error: 'warning' diagnostics seen but not expected: File builtin-assume-aligned.c Line 62: requested alignment must be 8192 bytes or smaller; assumption ignored llvm-svn: 374456
* Fix __builtin_assume_aligned with too large values.Erich Keane2019-10-101-0/+4
| | | | | | | | | | | | | | Code to handle __builtin_assume_aligned was allowing larger values, but would convert this to unsigned along the way. This patch removes the EmitAssumeAligned overloads that take unsigned to do away with this problem. Additionally, it adds a warning that values greater than 1 <<29 are ignored by LLVM. Differential Revision: https://reviews.llvm.org/D68824 llvm-svn: 374450
* Determine the attribute subject for diagnostics based on declarative ↵Aaron Ballman2017-11-261-1/+1
| | | | | | | | | | information in DeclNodes.td. This greatly reduces the number of enumerated values used for more complex diagnostics; these are now only required when the "attribute only applies to" diagnostic needs to be generated manually as part of semantic processing. This also clarifies some terminology used by the diagnostic (methods -> Objective-C methods, fields -> non-static data members, etc). Many of the tests needed to be updated in multiple places for the diagnostic wording tweaks. The first instance of the diagnostic for that attribute is fully specified and subsequent instances cut off the complete list (to make it easier if additional subjects are added in the future for the attribute). llvm-svn: 319002
* Support the assume_aligned function attributeHal Finkel2014-09-261-0/+15
| | | | | | | | | In addition to __builtin_assume_aligned, GCC also supports an assume_aligned attribute which specifies the alignment (and optional offset) of a function's return value. Here we implement support for the assume_aligned attribute by making use of the @llvm.assume intrinsic. llvm-svn: 218500
* Don't test really-large alignments for nowHal Finkel2014-09-081-1/+3
| | | | | | | | Temporarily comment out the test for really-large powers of two. This seems to be host-sensitive for some reason... trying to fix the clang-i386-freebsd builder. llvm-svn: 217351
* Add __builtin_assume and __builtin_assume_aligned using @llvm.assume.Hal Finkel2014-09-071-0/+43
This makes use of the recently-added @llvm.assume intrinsic to implement a __builtin_assume(bool) intrinsic (to provide additional information to the optimizer). This hooks up __assume in MS-compatibility mode to mirror __builtin_assume (the semantics have been intentionally kept compatible), and implements GCC's __builtin_assume_aligned as assume((p - o) & mask == 0). LLVM now contains special logic to deal with assumptions of this form. llvm-svn: 217349
OpenPOWER on IntegriCloud