summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-10-21 23:35:03 +0000
committerManman Ren <manman.ren@gmail.com>2016-10-21 23:35:03 +0000
commitc8c9415644fa2cce5b65d8ea005e62ac59a73708 (patch)
treec3132c408c11cec57d047dc89f86f93baeb4c0cc /clang/test/Modules
parent0db4549a1e2ba13806354cfe489df0e4fc94ced4 (diff)
downloadbcm5719-llvm-c8c9415644fa2cce5b65d8ea005e62ac59a73708.tar.gz
bcm5719-llvm-c8c9415644fa2cce5b65d8ea005e62ac59a73708.zip
Module: correctly set the module file kind when emitting file_modified.
rdar://28503343 Differential Revision: http://reviews.llvm.org/D25806 llvm-svn: 284899
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/module-file-modified.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Modules/module-file-modified.c b/clang/test/Modules/module-file-modified.c
new file mode 100644
index 00000000000..85018b521e2
--- /dev/null
+++ b/clang/test/Modules/module-file-modified.c
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t
+// RUN: mkdir %t
+// RUN: echo 'int foo = 0;' > %t/a.h
+// RUN: echo 'module A { header "a.h" }' > %t/m.modulemap
+// RUN: %clang_cc1 -fmodules -emit-module -fmodule-name=A -x c %t/m.modulemap -o %t/m.pcm
+// RUN: echo 'int bar;' > %t/a.h
+// RUN: not %clang_cc1 -fmodules -fmodule-file=%t/m.pcm -fmodule-map-file=%t/m.modulemap -x c %s -I%t -fsyntax-only 2>&1 | FileCheck %s
+#include "a.h"
+int foo = 0; // redefinition of 'foo'
+// CHECK: fatal error: file {{.*}} has been modified since the module file {{.*}} was built
+// REQUIRES: shell
OpenPOWER on IntegriCloud