[PATCH] D34788: [ASTReader] Add test for previous change r306583 / 145692e.

Graydon Hoare via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 28 16:23:56 PDT 2017


graydon created this revision.

Add a test for the change to ASTReader that reproduces the
logic for consolidating multiple ObjC interface definitions to the
case of multiple ObjC protocol definitions.

This test is a modified copy of the test that accompanied the original
change to interfaces, in 2ba1979.


https://reviews.llvm.org/D34788

Files:
  test/Modules/Inputs/lookup-assert-protocol/Base.h
  test/Modules/Inputs/lookup-assert-protocol/Derive.h
  test/Modules/Inputs/lookup-assert-protocol/H3.h
  test/Modules/Inputs/lookup-assert-protocol/module.map
  test/Modules/lookup-assert-protocol.m


Index: test/Modules/lookup-assert-protocol.m
===================================================================
--- /dev/null
+++ test/Modules/lookup-assert-protocol.m
@@ -0,0 +1,17 @@
+// RUN: rm -rf %t
+// RUN: %clang_cc1 -fmodules-cache-path=%t -fmodules -fimplicit-module-maps -I %S/Inputs/lookup-assert-protocol %s -verify
+// expected-no-diagnostics
+
+#include "Derive.h"
+#import <H3.h>
+
+__attribute__((objc_root_class))
+ at interface Thing<DerivedProtocol>
+ at end
+
+ at implementation Thing
+- (void)test {
+}
+- (void)test2 {
+}
+ at end
Index: test/Modules/Inputs/lookup-assert-protocol/module.map
===================================================================
--- /dev/null
+++ test/Modules/Inputs/lookup-assert-protocol/module.map
@@ -0,0 +1,4 @@
+module X {
+  header "H3.h"
+  export *
+}
Index: test/Modules/Inputs/lookup-assert-protocol/H3.h
===================================================================
--- /dev/null
+++ test/Modules/Inputs/lookup-assert-protocol/H3.h
@@ -0,0 +1 @@
+#include "Base.h"
Index: test/Modules/Inputs/lookup-assert-protocol/Derive.h
===================================================================
--- /dev/null
+++ test/Modules/Inputs/lookup-assert-protocol/Derive.h
@@ -0,0 +1,4 @@
+#include "Base.h"
+ at protocol DerivedProtocol<BaseProtocol>
+- (void) test2;
+ at end
Index: test/Modules/Inputs/lookup-assert-protocol/Base.h
===================================================================
--- /dev/null
+++ test/Modules/Inputs/lookup-assert-protocol/Base.h
@@ -0,0 +1,3 @@
+ at protocol BaseProtocol
+- (void) test;
+ at end


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34788.104543.patch
Type: text/x-patch
Size: 1577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170628/5aa71ddc/attachment.bin>


More information about the cfe-commits mailing list