1/*
2This is a clang style test case for checking that preprocessor
3defines match gcc.
4*/
5
6/*
7RUN: for arch in -m32 -m64; do \
8RUN: for lang in -std=gnu89 -ansi -std=c99 -std=gnu99; do \
9RUN: for input in c objective-c; do \
10RUN: for opts in "-O0" "-O1 -dynamic" "-O2 -static" "-Os"; do \
11RUN: echo "-- $arch, $lang, $input, $opts --"; \
12RUN: for cc in 0 1; do \
13RUN: if [ "$cc" == 0 ]; then \
14RUN: cc_prog=clang; \
15RUN: output=%t0; \
16RUN: else \
17RUN: cc_prog=gcc; \
18RUN: output=%t1; \
19RUN: fi; \
20RUN: $cc_prog $arch $lang $opts -march=core2 -dM -E -x $input %s | sort > $output; \
21RUN: done; \
22RUN: if (! diff %t0 %t1); then exit 1; fi; \
23RUN: done; \
24RUN: done; \
25RUN: done; \
26RUN: done;
27*/
28
29/* We don't care about this difference */
30#ifdef __PIC__
31#if __PIC__ == 1
32#undef __PIC__
33#undef __pic__
34#define __PIC__ 2
35#define __pic__ 2
36#endif
37#endif
38
39/* Undefine things we don't expect to match. */
40#undef __core2
41#undef __core2__
42#undef __SSSE3__
43
44/* Undefine things we don't expect to match. */
45#undef __DEC_EVAL_METHOD__
46#undef __INT16_TYPE__
47#undef __INT32_TYPE__
48#undef __INT64_TYPE__
49#undef __INT8_TYPE__
50#undef __SSP__
51#undef __APPLE_CC__
52#undef __VERSION__
53#undef __clang__
54#undef __llvm__
55#undef __nocona
56#undef __nocona__
57#undef __k8
58#undef __k8__
59#undef __tune_nocona__
60#undef __tune_core2__
61#undef __POINTER_WIDTH__
62#undef __INTPTR_TYPE__
63#undef __NO_MATH_INLINES
64
65#undef __DEC128_DEN__
66#undef __DEC128_EPSILON__
67#undef __DEC128_MANT_DIG__
68#undef __DEC128_MAX_EXP__
69#undef __DEC128_MAX__
70#undef __DEC128_MIN_EXP__
71#undef __DEC128_MIN__
72#undef __DEC32_DEN__
73#undef __DEC32_EPSILON__
74#undef __DEC32_MANT_DIG__
75#undef __DEC32_MAX_EXP__
76#undef __DEC32_MAX__
77#undef __DEC32_MIN_EXP__
78#undef __DEC32_MIN__
79#undef __DEC64_DEN__
80#undef __DEC64_EPSILON__
81#undef __DEC64_MANT_DIG__
82#undef __DEC64_MAX_EXP__
83#undef __DEC64_MAX__
84#undef __DEC64_MIN_EXP__
85#undef __DEC64_MIN__
86

source code of clang/utils/builtin-defines.c