diff options
| author | Douglas Gregor <dgregor@apple.com> | 2012-01-29 22:35:57 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2012-01-29 22:35:57 +0000 |
| commit | b9f9aea13c69cd62953ff7abc92a04e62ba1b494 (patch) | |
| tree | 02c320cca5a126842a9cf3e2106208a764db7654 /clang | |
| parent | fc5aae33b72064d680b57a97907f098775e8f351 (diff) | |
| download | bcm5719-llvm-b9f9aea13c69cd62953ff7abc92a04e62ba1b494.tar.gz bcm5719-llvm-b9f9aea13c69cd62953ff7abc92a04e62ba1b494.zip | |
If there's no math.h, then tgmath.h should just be empty
llvm-svn: 149209
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Headers/tgmath.h | 2 | ||||
| -rw-r--r-- | clang/test/Modules/compiler_builtins.m | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Headers/tgmath.h b/clang/lib/Headers/tgmath.h index 1b0b9d24c1d..0617ae2ddb3 100644 --- a/clang/lib/Headers/tgmath.h +++ b/clang/lib/Headers/tgmath.h @@ -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 @@ static long double #undef _TG_ATTRS #endif /* __cplusplus */ +#endif /* __has_include(<math.h>) */ #endif /* __TGMATH_H */ diff --git a/clang/test/Modules/compiler_builtins.m b/clang/test/Modules/compiler_builtins.m index 254494a2423..3cf24142d33 100644 --- a/clang/test/Modules/compiler_builtins.m +++ b/clang/test/Modules/compiler_builtins.m @@ -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 @@ float getFltMax() { return FLT_MAX; } 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'}} |

