Alp Toker | 4f43e55 | 2014-06-10 06:08:51 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -Wdate-time -Wno-builtin-macro-redefined %s -verify -E |
Alp Toker | ed2c033 | 2014-06-10 06:09:00 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -Wdate-time -Wno-builtin-macro-redefined %s -DIS_SYSHEADER -verify -E |
| 3 | // RUN: not %clang_cc1 -Werror=date-time -Wno-builtin-macro-redefined %s -DIS_SYSHEADER -E 2>&1 | grep 'error: expansion' | count 3 |
| 4 | |
| 5 | |
| 6 | #ifdef IS_HEADER |
| 7 | |
| 8 | #ifdef IS_SYSHEADER |
| 9 | #pragma clang system_header |
| 10 | #endif |
Alp Toker | 4f43e55 | 2014-06-10 06:08:51 +0000 | [diff] [blame] | 11 | |
| 12 | __TIME__ // expected-warning {{expansion of date or time macro is not reproducible}} |
| 13 | __DATE__ // expected-warning {{expansion of date or time macro is not reproducible}} |
| 14 | __TIMESTAMP__ // expected-warning {{expansion of date or time macro is not reproducible}} |
| 15 | |
| 16 | #define __TIME__ |
| 17 | __TIME__ |
Alp Toker | ed2c033 | 2014-06-10 06:09:00 +0000 | [diff] [blame] | 18 | |
| 19 | #else |
| 20 | |
| 21 | #define IS_HEADER |
| 22 | #include __FILE__ |
| 23 | #endif |