summaryrefslogtreecommitdiffstats
path: root/clang/test/Modules/Inputs
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-07-01 00:06:47 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2017-07-01 00:06:47 +0000
commitdf0ee34bc2523f11b907311670c776cb3de108c1 (patch)
tree1426e07d6db57ced9bfe03e6e1fe9b4f00e298c8 /clang/test/Modules/Inputs
parent057c82cf25a0c8bd4150eb715310b1d74a538aac (diff)
downloadbcm5719-llvm-df0ee34bc2523f11b907311670c776cb3de108c1.tar.gz
bcm5719-llvm-df0ee34bc2523f11b907311670c776cb3de108c1.zip
[Modules] Implement ODR-like semantics for tag types in C/ObjC
Allow ODR for ObjC/C in the sense that we won't keep more that one definition around (merge them). However, ensure the decl pass the structural compatibility check in C11 6.2.7/1, for that, reuse the structural equivalence checks used by the ASTImporter. Few other considerations: - Create error diagnostics for tag types mismatches and thread them into the structural equivalence checks. - Note that by doing this we only support redefinition between types that are considered "compatible types" by C. This is mixed approach of the suggestions discussed in http://lists.llvm.org/pipermail/cfe-dev/2017-March/053257.html Differential Revision: https://reviews.llvm.org/D31778 rdar://problem/31909368 llvm-svn: 306918
Diffstat (limited to 'clang/test/Modules/Inputs')
-rw-r--r--clang/test/Modules/Inputs/F.framework/Headers/F.h1
-rw-r--r--clang/test/Modules/Inputs/F.framework/Modules/module.modulemap7
-rw-r--r--clang/test/Modules/Inputs/F.framework/Modules/module.private.modulemap7
-rw-r--r--clang/test/Modules/Inputs/F.framework/PrivateHeaders/NS.h19
4 files changed, 34 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/F.framework/Headers/F.h b/clang/test/Modules/Inputs/F.framework/Headers/F.h
new file mode 100644
index 00000000000..4f705f00e1a
--- /dev/null
+++ b/clang/test/Modules/Inputs/F.framework/Headers/F.h
@@ -0,0 +1 @@
+// F.h
diff --git a/clang/test/Modules/Inputs/F.framework/Modules/module.modulemap b/clang/test/Modules/Inputs/F.framework/Modules/module.modulemap
new file mode 100644
index 00000000000..e414776c536
--- /dev/null
+++ b/clang/test/Modules/Inputs/F.framework/Modules/module.modulemap
@@ -0,0 +1,7 @@
+framework module F [extern_c] [system] {
+ umbrella header "F.h"
+ module * {
+ export *
+ }
+ export *
+}
diff --git a/clang/test/Modules/Inputs/F.framework/Modules/module.private.modulemap b/clang/test/Modules/Inputs/F.framework/Modules/module.private.modulemap
new file mode 100644
index 00000000000..69486a2a641
--- /dev/null
+++ b/clang/test/Modules/Inputs/F.framework/Modules/module.private.modulemap
@@ -0,0 +1,7 @@
+module F.Private [system] {
+ explicit module NS {
+ header "NS.h"
+ export *
+ }
+ export *
+}
diff --git a/clang/test/Modules/Inputs/F.framework/PrivateHeaders/NS.h b/clang/test/Modules/Inputs/F.framework/PrivateHeaders/NS.h
new file mode 100644
index 00000000000..5e947ba9051
--- /dev/null
+++ b/clang/test/Modules/Inputs/F.framework/PrivateHeaders/NS.h
@@ -0,0 +1,19 @@
+struct NS {
+ int a;
+ int b;
+};
+
+enum NSE {
+ FST = 22,
+ SND = 43,
+ TRD = 55
+};
+
+#define NS_ENUM(_type, _name) \
+ enum _name : _type _name; \
+ enum _name : _type
+
+typedef NS_ENUM(int, NSMyEnum) {
+ MinX = 11,
+ MinXOther = MinX,
+};
OpenPOWER on IntegriCloud