summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/struct-packed-align.c
Commit message (Collapse)AuthorAgeFilesLines
* Implement target-specific __attribute__((aligned)) valueUlrich Weigand2015-04-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The GCC construct __attribute__((aligned)) is defined to set alignment to "the default alignment for the target architecture" according to the GCC documentation: The default alignment is sufficient for all scalar types, but may not be enough for all vector types on a target that supports vector operations. The default alignment is fixed for a particular target ABI. clang currently hard-coded an alignment of 16 bytes for that construct, which is correct on some platforms (including X86), but wrong on others (including SystemZ). Since this value is ABI-relevant, it is important to get correct for compatibility purposes. This patch adds a new TargetInfo member "DefaultAlignForAttributeAligned" that targets can set to the appropriate default __attribute__((aligned)) value. Note that I'm deliberately *not* using the existing "SuitableAlign" value, which is used to set the pre-defined macro __BIGGEST_ALIGNMENT__, since those two values may not be the same on all platforms. In fact, on X86, __attribute__((aligned)) always uses 16-byte alignment, while __BIGGEST_ALIGNMENT__ may be larger if AVX-2 or AVX-512 are supported. (This is actually not yet correctly implemented in clang either.) The patch provides a value for DefaultAlignForAttributeAligned only for SystemZ, and leaves the default for all other targets at 16, which means no visible change in behavior on all other targets. (The value is still wrong for some other targets, but I'd prefer to leave it to the target maintainers for those platforms to fix.) llvm-svn: 235397
* clang/test/Sema/struct-packed-align.c: Add the case in MS mode that ↵NAKAMURA Takumi2014-08-041-4/+6
| | | | | | | | | | alignment doesn't affect packing. Also, revert a couple of suppressions. r214298, "Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64." r214301, "Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating." llvm-svn: 214794
* Trailing linefeed.NAKAMURA Takumi2014-08-041-4/+0
| | | | llvm-svn: 214793
* Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.NAKAMURA Takumi2014-07-301-0/+3
| | | | | | FIXME: This test is incompatible to MS compat mode. FIXME: Don't suppress this also on mingw. :-p llvm-svn: 214301
* Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64.NAKAMURA Takumi2014-07-301-0/+1
| | | | llvm-svn: 214298
* Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs2012-10-191-0/+1
| | | | | | VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. llvm-svn: 166280
* Fix PR9253, allowing attribute(aligned) to reduce the alignment ofChris Lattner2011-02-191-0/+15
| | | | | | a typedef. llvm-svn: 126059
* Support __attribute__((packed)) (along with other attributes) at theDouglas Gregor2010-03-291-0/+8
| | | | | | end of a struct/class/union in C++, from Justin Bogner! llvm-svn: 99811
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - This is designed to make it obvious that %clang_cc1 is a "test variable" which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it can be useful to redefine what gets run as 'clang -cc1' (for example, to set a default target). llvm-svn: 91446
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* __attribute__((aligned)) was being ignored!Daniel Dunbar2009-02-181-0/+8
| | | | | | This knocks out another 8 gcc/compat/i386 & x86_64 failures. llvm-svn: 64947
* Merge postfix attributes on record decls.Daniel Dunbar2008-10-031-0/+12
| | | | llvm-svn: 57019
* Cleanup/refactoring of Sema struct layout. This patch unifies the structEli Friedman2008-05-301-0/+20
| | | | | | | | | | and union codepaths and fixes some minor bugs. I'm reasonably confident this is accurate, at least for X86. I'll correct any bugs as I find them; I haven't found any for a while, though. llvm-svn: 51762
* Fix rdar://5921025 a crash on the included testcase.Chris Lattner2008-05-091-0/+7
| | | | llvm-svn: 50885
* Add more testsAnders Carlsson2008-02-161-8/+35
| | | | llvm-svn: 47217
* Make sizeof and __alignof work correctly with packed structs.Anders Carlsson2008-02-161-0/+37
llvm-svn: 47202
OpenPOWER on IntegriCloud