summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorEd Schouten <ed@80386.nl>2013-09-29 07:54:52 +0000
committerEd Schouten <ed@80386.nl>2013-09-29 07:54:52 +0000
commitd062146896ffa711c1f413b002d964eae4c30e4a (patch)
treefc473badf0821e6f6b2c99ebcf5bb17db580d587 /clang/test
parente75666f47a9aed06c6e82dc009575ad10e68a8c0 (diff)
downloadbcm5719-llvm-d062146896ffa711c1f413b002d964eae4c30e4a.tar.gz
bcm5719-llvm-d062146896ffa711c1f413b002d964eae4c30e4a.zip
Add character set related __STDC_* definitions.
Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's exclusively. This means that we can define __STDC_UTF_16__ and __STDC_UTF_32__ unconditionally. While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's wchar_t's don't encode characters as ISO-10646; the encoding depends on the locale used. Because the character set used might not be a superset of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__. llvm-svn: 191631
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Preprocessor/init.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/test/Preprocessor/init.c b/clang/test/Preprocessor/init.c
index 38ddaa6a14a..ce7ee09abe1 100644
--- a/clang/test/Preprocessor/init.c
+++ b/clang/test/Preprocessor/init.c
@@ -49,6 +49,14 @@
// C99:#define __STRICT_ANSI__ 1
//
//
+// RUN: %clang_cc1 -std=c11 -E -dM < /dev/null | FileCheck -check-prefix C11 %s
+//
+// C11:#define __STDC_UTF_16__ 1
+// C11:#define __STDC_UTF_32__ 1
+// C11:#define __STDC_VERSION__ 201112L
+// C11:#define __STRICT_ANSI__ 1
+//
+//
// RUN: %clang_cc1 -E -dM < /dev/null | FileCheck -check-prefix COMMON %s
//
// COMMON:#define __CONSTANT_CFSTRINGS__ 1
@@ -2925,6 +2933,12 @@
// X86_64-LINUX:#define __x86_64 1
// X86_64-LINUX:#define __x86_64__ 1
//
+// RUN: %clang_cc1 -E -dM -ffreestanding -triple=x86_64-unknown-freebsd9.1 < /dev/null | FileCheck -check-prefix X86_64-FREEBSD %s
+//
+// X86_64-FREEBSD:#define __FreeBSD__ 9
+// X86_64-FREEBSD:#define __FreeBSD_cc_version 900001
+// X86_64-FREEBSD:#define __STDC_MB_MIGHT_NEQ_WC__ 1
+//
// RUN: %clang_cc1 -E -dM -ffreestanding -triple=sparc64-none-none < /dev/null | FileCheck -check-prefix SPARCV9 %s
// SPARCV9:#define __INT64_TYPE__ long int
// SPARCV9:#define __INTMAX_TYPE__ long int
OpenPOWER on IntegriCloud