summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-10-17 01:42:53 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-10-17 01:42:53 +0000
commit9887d79af5fecf1413515e909644f6a23f491b69 (patch)
tree53f3726b93aa64f0b655514db1fcd7184803713f /clang/test/Modules
parent32e9c6465b3beab8ee95f78eb75c4d159fb060b3 (diff)
downloadbcm5719-llvm-9887d79af5fecf1413515e909644f6a23f491b69.tar.gz
bcm5719-llvm-9887d79af5fecf1413515e909644f6a23f491b69.zip
PR21215: Support -fmodule-map-file being specified multiple times. Support
loading multiple module map files from the same directory. llvm-svn: 220020
Diffstat (limited to 'clang/test/Modules')
-rw-r--r--clang/test/Modules/Inputs/modular_maps/c.h4
-rw-r--r--clang/test/Modules/Inputs/modular_maps/common.h2
-rw-r--r--clang/test/Modules/Inputs/modular_maps/modulec.map3
-rw-r--r--clang/test/Modules/modular_maps.cpp8
4 files changed, 13 insertions, 4 deletions
diff --git a/clang/test/Modules/Inputs/modular_maps/c.h b/clang/test/Modules/Inputs/modular_maps/c.h
new file mode 100644
index 00000000000..6e3468e7260
--- /dev/null
+++ b/clang/test/Modules/Inputs/modular_maps/c.h
@@ -0,0 +1,4 @@
+#ifndef C_H
+#define C_H
+const int c = 5;
+#endif
diff --git a/clang/test/Modules/Inputs/modular_maps/common.h b/clang/test/Modules/Inputs/modular_maps/common.h
index f690bcbd399..349bf5f7c47 100644
--- a/clang/test/Modules/Inputs/modular_maps/common.h
+++ b/clang/test/Modules/Inputs/modular_maps/common.h
@@ -1,4 +1,4 @@
#ifndef COMMON_H
#define COMMON_H
-const int c = 2;
+const int x = 2;
#endif
diff --git a/clang/test/Modules/Inputs/modular_maps/modulec.map b/clang/test/Modules/Inputs/modular_maps/modulec.map
new file mode 100644
index 00000000000..c5a1ffe4577
--- /dev/null
+++ b/clang/test/Modules/Inputs/modular_maps/modulec.map
@@ -0,0 +1,3 @@
+module C {
+ header "c.h"
+}
diff --git a/clang/test/Modules/modular_maps.cpp b/clang/test/Modules/modular_maps.cpp
index 9c9aba85a91..484e727c13e 100644
--- a/clang/test/Modules/modular_maps.cpp
+++ b/clang/test/Modules/modular_maps.cpp
@@ -1,8 +1,10 @@
// RUN: rm -rf %t
-// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -I %S/Inputs/modular_maps %s -verify
+// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -fmodule-map-file=%S/Inputs/modular_maps/modulec.map -I %S/Inputs/modular_maps %s -verify
+// RUN: %clang_cc1 -x objective-c++ -fmodules-cache-path=%t -fmodules -fmodule-map-file=%S/Inputs/modular_maps/modulec.map -fmodule-map-file=%S/Inputs/modular_maps/modulea.map -I %S/Inputs/modular_maps %s -verify
#include "common.h"
#include "a.h"
#include "b.h" // expected-error {{private header}}
-const int v = a + c;
-const int val = a + b + c; // expected-error {{undeclared identifier}}
+@import C;
+const int v = a + c + x;
+const int val = a + b + c + x; // expected-error {{undeclared identifier}}
OpenPOWER on IntegriCloud