diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-10-05 20:39:30 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-10-05 20:39:30 +0000 |
commit | 7b6d8c4269d7c0b3a19b427127efd810e785250f (patch) | |
tree | 00edb75b437327c34641b49724eeb29289ab8e4b | |
parent | 0e5d4ef3155651af17a90fdc07d9f80b33935c0c (diff) |
Add script for checking builtin macros verse another compiler ($CC or
gcc).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57133 91177308-0d34-0410-b5e6-96231b3b80d8
-rwxr-xr-x | utils/CheckBuiltinMacros.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/utils/CheckBuiltinMacros.sh b/utils/CheckBuiltinMacros.sh new file mode 100755 index 0000000000..6a8573c0c1 --- /dev/null +++ b/utils/CheckBuiltinMacros.sh @@ -0,0 +1,23 @@ +#!/bin/sh +set -ex + +if [ -z "$CC" ]; then + CC="gcc" +fi + +SRCLANG=c +MACROLIST=macro-list.txt +CCDEFS=cc-definitions.txt +CLANGDEFS=clang-definitions.txt + +# Gather list of macros as "NAME" = NAME. +$CC -dM -E -x $SRCLANG /dev/null -o - | \ +grep "#define" | sort -f | sed -e "s/#define \([^ ]*\) .*/\"\1\" = \1/" > $MACROLIST + +$CC -E -x $SRCLANG $MACROLIST > $CCDEFS + +clang -E -x $SRCLANG $MACROLIST > $CLANGDEFS + +diff $CCDEFS $CLANGDEFS + + |