[cfe-commits] [PATCHES] add __BYTE_ORDER__ predefined macro, improve tests

nobled nobled at dreamwidth.org
Mon Jul 9 16:34:40 PDT 2012


The __BYTE_ORDER__ predefined macro was added in GCC 4.6:
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html

There's a similar macro, __FLOAT_WORD_ORDER__, but it looks like it
mainly exist to accommodate fairly obscure architectures and ARM's
old FPA instructions, so it doesn't seem worth bothering with.

(Not sure if the TCE pseudo-architecture is actually supposed to be
big-endian or not, but that's how it comes out right now. None of the
targets in Targets.cpp seem to ever say "BigEndian = true;" -- is
it default-initialized to true somewhere else?)

While adding the preprocessor tests for it I noticed some oversights
that the other three patches fix:

- add NVPTX and NVPTX64 predefined macro tests
- add tests for __OPTIMIZE_SIZE__, which uncovered an overflow bug with -Oz
- add more positive tests for _LP64 and __LP64__ that should have
existed on e.g. mips64, as well as negative tests to all the other,
32-bit architectures.


Okay to commit?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-test-Preprocessor-add-NVPTX-predefine-tests.patch
Type: application/octet-stream
Size: 9022 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120709/c1cbbf06/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Preprocessor-add-__BYTE_ORDER__-predefined-macro.patch
Type: application/octet-stream
Size: 8603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120709/c1cbbf06/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-test-Preprocessor-test-__OPTIMIZE_SIZE__-and-__NO_IN.patch
Type: application/octet-stream
Size: 8189 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120709/c1cbbf06/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-Frontend-define-_LP64-in-a-target-independent-way.patch
Type: application/octet-stream
Size: 11964 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120709/c1cbbf06/attachment-0003.obj>


More information about the cfe-commits mailing list