summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-02-13 23:50:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-02-13 23:50:20 +0000
commitec87a50a3e9175441b5e4b38cc477881c078edf8 (patch)
treed12a6d127ce020625b20516b3fb086547aa5ab59 /clang/test
parent9ea81b00410b8e5dea6ac9a57fc8f38752b5db12 (diff)
downloadbcm5719-llvm-ec87a50a3e9175441b5e4b38cc477881c078edf8.tar.gz
bcm5719-llvm-ec87a50a3e9175441b5e4b38cc477881c078edf8.zip
[modules] If we have a choice between including a file textually and importing
a prebuilt form from a module, prefer the modular form, all else being equal. llvm-svn: 229188
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Modules/Inputs/header-in-multiple-maps/a.h1
-rw-r--r--clang/test/Modules/Inputs/header-in-multiple-maps/map13
-rw-r--r--clang/test/Modules/Inputs/header-in-multiple-maps/map23
-rw-r--r--clang/test/Modules/Inputs/header-in-multiple-maps/map33
-rw-r--r--clang/test/Modules/header-in-multiple-maps.cpp9
5 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/header-in-multiple-maps/a.h b/clang/test/Modules/Inputs/header-in-multiple-maps/a.h
new file mode 100644
index 00000000000..4c5cd949f23
--- /dev/null
+++ b/clang/test/Modules/Inputs/header-in-multiple-maps/a.h
@@ -0,0 +1 @@
+struct A {};
diff --git a/clang/test/Modules/Inputs/header-in-multiple-maps/map1 b/clang/test/Modules/Inputs/header-in-multiple-maps/map1
new file mode 100644
index 00000000000..ba9baac00ca
--- /dev/null
+++ b/clang/test/Modules/Inputs/header-in-multiple-maps/map1
@@ -0,0 +1,3 @@
+module a { header "a.h" }
+module b { header "a.h" }
+module c { textual header "a.h" }
diff --git a/clang/test/Modules/Inputs/header-in-multiple-maps/map2 b/clang/test/Modules/Inputs/header-in-multiple-maps/map2
new file mode 100644
index 00000000000..67e0df3b55f
--- /dev/null
+++ b/clang/test/Modules/Inputs/header-in-multiple-maps/map2
@@ -0,0 +1,3 @@
+module a { textual header "a.h" }
+module b { header "a.h" }
+module c { header "a.h" }
diff --git a/clang/test/Modules/Inputs/header-in-multiple-maps/map3 b/clang/test/Modules/Inputs/header-in-multiple-maps/map3
new file mode 100644
index 00000000000..c859fd74b5d
--- /dev/null
+++ b/clang/test/Modules/Inputs/header-in-multiple-maps/map3
@@ -0,0 +1,3 @@
+module a { header "a.h" }
+module b { textual header "a.h" }
+module c { header "a.h" }
diff --git a/clang/test/Modules/header-in-multiple-maps.cpp b/clang/test/Modules/header-in-multiple-maps.cpp
new file mode 100644
index 00000000000..a9c0c80eca8
--- /dev/null
+++ b/clang/test/Modules/header-in-multiple-maps.cpp
@@ -0,0 +1,9 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/header-in-multiple-maps -fmodule-map-file=%S/Inputs/header-in-multiple-maps/map1 -verify %s
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/header-in-multiple-maps -fmodule-map-file=%S/Inputs/header-in-multiple-maps/map2 -verify %s
+// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I%S/Inputs/header-in-multiple-maps -fmodule-map-file=%S/Inputs/header-in-multiple-maps/map3 -verify %s
+// expected-no-diagnostics
+
+#include "a.h"
+#include "a.h"
+A *p;
OpenPOWER on IntegriCloud