blob: e8d3356277dbbe224de2808aa148b5631c5ad987 [file] [log] [blame]
Daniel Dunbar3bbc7532009-04-08 18:03:55 +00001/*
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 -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 __DEC_EVAL_METHOD__
41#undef __INT16_TYPE__
42#undef __INT32_TYPE__
43#undef __INT64_TYPE__
44#undef __INT8_TYPE__
45#undef __SSP__
46#undef __APPLE_CC__
47#undef __VERSION__
48#undef __clang__
49#undef __llvm__
50#undef __nocona
51#undef __nocona__
52#undef __k8
53#undef __k8__
54#undef __tune_nocona__
55#undef __tune_core2__
56#undef __POINTER_WIDTH__
57#undef __INTPTR_TYPE__
Daniel Dunbar912f3912009-04-20 23:53:56 +000058#undef __NO_MATH_INLINES
Daniel Dunbar3bbc7532009-04-08 18:03:55 +000059
60#undef __DEC128_DEN__
61#undef __DEC128_EPSILON__
62#undef __DEC128_MANT_DIG__
63#undef __DEC128_MAX_EXP__
64#undef __DEC128_MAX__
65#undef __DEC128_MIN_EXP__
66#undef __DEC128_MIN__
67#undef __DEC32_DEN__
68#undef __DEC32_EPSILON__
69#undef __DEC32_MANT_DIG__
70#undef __DEC32_MAX_EXP__
71#undef __DEC32_MAX__
72#undef __DEC32_MIN_EXP__
73#undef __DEC32_MIN__
74#undef __DEC64_DEN__
75#undef __DEC64_EPSILON__
76#undef __DEC64_MANT_DIG__
77#undef __DEC64_MAX_EXP__
78#undef __DEC64_MAX__
79#undef __DEC64_MIN_EXP__
80#undef __DEC64_MIN__