[cfe-commits] r149209 - in /cfe/trunk: lib/Headers/tgmath.h test/Modules/compiler_builtins.m

Douglas Gregor dgregor at apple.com
Sun Jan 29 14:35:57 PST 2012


Author: dgregor
Date: Sun Jan 29 16:35:57 2012
New Revision: 149209

URL: http://llvm.org/viewvc/llvm-project?rev=149209&view=rev
Log:
If there's no math.h, then tgmath.h should just be empty

Modified:
    cfe/trunk/lib/Headers/tgmath.h
    cfe/trunk/test/Modules/compiler_builtins.m

Modified: cfe/trunk/lib/Headers/tgmath.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/tgmath.h?rev=149209&r1=149208&r2=149209&view=diff
==============================================================================
--- cfe/trunk/lib/Headers/tgmath.h (original)
+++ cfe/trunk/lib/Headers/tgmath.h Sun Jan 29 16:35:57 2012
@@ -26,6 +26,7 @@
 #define __TGMATH_H
 
 /* C99 7.22 Type-generic math <tgmath.h>. */
+#if __has_include(<math.h>)
 #include <math.h>
 
 /* C++ handles type genericity with overloading in math.h. */
@@ -1354,4 +1355,5 @@
 #undef _TG_ATTRS
 
 #endif /* __cplusplus */
+#endif /* __has_include(<math.h>) */
 #endif /* __TGMATH_H */

Modified: cfe/trunk/test/Modules/compiler_builtins.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/compiler_builtins.m?rev=149209&r1=149208&r2=149209&view=diff
==============================================================================
--- cfe/trunk/test/Modules/compiler_builtins.m (original)
+++ cfe/trunk/test/Modules/compiler_builtins.m Sun Jan 29 16:35:57 2012
@@ -1,5 +1,5 @@
 // RUN: rm -rf %t
-// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t %s
+// RUN: %clang_cc1 -fmodules -fmodule-cache-path %t -verify %s
 
 @import __compiler_builtins.float_constants;
 
@@ -9,5 +9,4 @@
 
 char getCharMax() { return CHAR_MAX; }
 
-// FIXME: Re-enable this test.
-//size_t size; // expected-error{{unknown type name 'size_t'}}
+size_t size; // expected-error{{unknown type name 'size_t'}}





More information about the cfe-commits mailing list