xref: /minix3/external/bsd/llvm/dist/clang/test/Lexer/warn-date-time.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -Wdate-time -Wno-builtin-macro-redefined %s -verify -E
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -Wdate-time -Wno-builtin-macro-redefined %s -DIS_SYSHEADER -verify -E
3*0a6a1f1dSLionel Sambuc // RUN: not %clang_cc1 -Werror=date-time -Wno-builtin-macro-redefined %s -DIS_SYSHEADER -E 2>&1 | grep 'error: expansion' | count 3
4*0a6a1f1dSLionel Sambuc 
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc #ifdef IS_HEADER
7*0a6a1f1dSLionel Sambuc 
8*0a6a1f1dSLionel Sambuc #ifdef IS_SYSHEADER
9*0a6a1f1dSLionel Sambuc #pragma clang system_header
10*0a6a1f1dSLionel Sambuc #endif
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc __TIME__ // expected-warning {{expansion of date or time macro is not reproducible}}
13*0a6a1f1dSLionel Sambuc __DATE__  // expected-warning {{expansion of date or time macro is not reproducible}}
14*0a6a1f1dSLionel Sambuc __TIMESTAMP__ // expected-warning {{expansion of date or time macro is not reproducible}}
15*0a6a1f1dSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc #define __TIME__
17*0a6a1f1dSLionel Sambuc __TIME__
18*0a6a1f1dSLionel Sambuc 
19*0a6a1f1dSLionel Sambuc #else
20*0a6a1f1dSLionel Sambuc 
21*0a6a1f1dSLionel Sambuc #define IS_HEADER
22*0a6a1f1dSLionel Sambuc #include __FILE__
23*0a6a1f1dSLionel Sambuc #endif
24