]> granicus.if.org Git - clang/commitdiff
Test files I forgot to svn add in r220448.
authorRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 22 Oct 2014 23:52:04 +0000 (23:52 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Wed, 22 Oct 2014 23:52:04 +0000 (23:52 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@220449 91177308-0d34-0410-b5e6-96231b3b80d8

test/Modules/Inputs/declare-use/k.h [new file with mode: 0644]
test/Modules/Inputs/declare-use/l.h [new file with mode: 0644]
test/Modules/textual-headers.cpp [new file with mode: 0644]

diff --git a/test/Modules/Inputs/declare-use/k.h b/test/Modules/Inputs/declare-use/k.h
new file mode 100644 (file)
index 0000000..338178e
--- /dev/null
@@ -0,0 +1,8 @@
+#ifdef GIMME_A_K
+
+#ifndef K_H
+#define K_H
+const int k = 42;
+#endif
+
+#endif
diff --git a/test/Modules/Inputs/declare-use/l.h b/test/Modules/Inputs/declare-use/l.h
new file mode 100644 (file)
index 0000000..a43fd1a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifdef GIMME_AN_L
+
+#ifndef L_H
+#define L_H
+const int l = 42;
+#endif
+
+#endif
diff --git a/test/Modules/textual-headers.cpp b/test/Modules/textual-headers.cpp
new file mode 100644 (file)
index 0000000..d1be8ad
--- /dev/null
@@ -0,0 +1,11 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodule-maps -fmodules-cache-path=%t -fmodules-strict-decluse -fmodule-name=XG -I %S/Inputs/declare-use %s -verify
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fmodules-strict-decluse -fmodule-name=XG -I %S/Inputs/declare-use %s -verify
+
+#define GIMME_A_K
+#include "k.h"
+
+#define GIMME_AN_L
+#include "l.h" // expected-error {{module XG does not depend on a module exporting 'l.h'}}
+
+const int g = k + l;