summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/override-layout.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix the layout of bitfields in ms_struct unions: theirJohn McCall2015-08-191-3/+2
| | | | | | | | | | | | | | | alignment is ignored, and they always allocate a complete storage unit. Also, change the dumping of AST record layouts: use the more readable C++-style dumping even in C, include bitfield offset information in the dump, and don't print sizeof/alignof information for fields of record type, since we don't do so for bases or other kinds of field. rdar://22275433 llvm-svn: 245514
* Changes so that a few tests do not fail when running under guarded malloc.Argyrios Kyrtzidis2013-07-121-3/+3
| | | | | | | Guarded malloc emits some messages at the beginning in stderr when enabled. These messages caused a few tests to fail. llvm-svn: 186219
* Clean up empty struct/union recognition.Serge Pavlov2013-06-171-26/+16
| | | | | | | | | Make use of getTypeSizeInChars to detect structs/unions of zero size. It allows more accurate detection of types of zero size. It however has a side effect - sequence of used types may change, that is why the test 'override-layout' was modified. llvm-svn: 184088
* Try harder to get X7 definedDouglas Gregor2012-01-261-0/+1
| | | | llvm-svn: 149072
* Force layout of more of the unions and structures in this testDouglas Gregor2012-01-261-1/+7
| | | | llvm-svn: 149066
* Suppress any warnings from this test. They aren't interesting, and theyChandler Carruth2012-01-261-3/+3
| | | | | | | | | | end up in the same output file as the layout stuff. There may even be a race condition which is causing this output to confuse the FileCheck in some cases. I actually don't know how on earth the parsing of the layout file even works given that there are diagnostics in the middle of it. ;] llvm-svn: 149058
* Extend the ExternalASTSource interface to allow the AST source toDouglas Gregor2012-01-261-0/+167
provide the layout of records, rather than letting Clang compute the layout itself. LLDB provides the motivation for this feature: because various layout-altering attributes (packed, aligned, etc.) don't get reliably get placed into DWARF, the record layouts computed by LLDB from the reconstructed records differ from the actual layouts, and badness occurs. This interface lets the DWARF data drive layout, so we don't need the attributes preserved to get the answer write. The testing methodology for this change is fun. I've introduced a variant of -fdump-record-layouts called -fdump-record-layouts-simple that always has the simple C format and provides size/alignment/field offsets. There is also a -cc1 option -foverride-record-layout=<file> to take the output of -fdump-record-layouts-simple and parse it to produce a set of overridden layouts, which is introduced into the AST via a testing-only ExternalASTSource (called LayoutOverrideSource). Each test contains a number of records to lay out, which use various layout-changing attributes, and then dumps the layouts. We then run the test again, using the preprocessor to eliminate the layout-changing attributes entirely (which would give us different layouts for the records), but supplying the previously-computed record layouts. Finally, we diff the layouts produced from the two runs to be sure that they are identical. Note that this code makes the assumption that we don't *have* to provide the offsets of bases or virtual bases to get the layout right, because the alignment attributes don't affect it. I believe this assumption holds, but if it does not, we can extend LayoutOverrideSource to also provide base offset information. Fixes the Clang side of <rdar://problem/10169539>. llvm-svn: 149055
OpenPOWER on IntegriCloud