summaryrefslogtreecommitdiffstats
path: root/clang/test/Lexer
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2014-06-10 06:08:51 +0000
committerAlp Toker <alp@nuanti.com>2014-06-10 06:08:51 +0000
commit4f43e554081ecac149fe360bee6eef2ed7dab8ea (patch)
tree46e5fdd3b3b27021b25babfd7807fe3ccddf86d4 /clang/test/Lexer
parentf9fc2dcb8775d9df9090d3d450171a6a2f847259 (diff)
downloadbcm5719-llvm-4f43e554081ecac149fe360bee6eef2ed7dab8ea.tar.gz
bcm5719-llvm-4f43e554081ecac149fe360bee6eef2ed7dab8ea.zip
Implement -Wdate-time preprocessor warning
This GCC warning is useful for validating reproducible builds and might help when tracking down issues with modules too. llvm-svn: 210511
Diffstat (limited to 'clang/test/Lexer')
-rw-r--r--clang/test/Lexer/warn-date-time.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/test/Lexer/warn-date-time.c b/clang/test/Lexer/warn-date-time.c
new file mode 100644
index 00000000000..38999333aeb
--- /dev/null
+++ b/clang/test/Lexer/warn-date-time.c
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -Wdate-time -Wno-builtin-macro-redefined %s -verify -E
+
+__TIME__ // expected-warning {{expansion of date or time macro is not reproducible}}
+__DATE__ // expected-warning {{expansion of date or time macro is not reproducible}}
+__TIMESTAMP__ // expected-warning {{expansion of date or time macro is not reproducible}}
+
+#define __TIME__
+__TIME__
OpenPOWER on IntegriCloud