]> granicus.if.org Git - clang/commitdiff
Test for selector-warning PCH patch.
authorFariborz Jahanian <fjahanian@apple.com>
Fri, 23 Jul 2010 20:32:57 +0000 (20:32 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Fri, 23 Jul 2010 20:32:57 +0000 (20:32 +0000)
radar 6507158.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109261 91177308-0d34-0410-b5e6-96231b3b80d8

test/PCH/selector-warning.h [new file with mode: 0644]
test/PCH/selector-warning.m [new file with mode: 0644]

diff --git a/test/PCH/selector-warning.h b/test/PCH/selector-warning.h
new file mode 100644 (file)
index 0000000..bd41929
--- /dev/null
@@ -0,0 +1,24 @@
+typedef struct objc_selector    *SEL;
+
+@interface Foo 
+- (void) NotOK;
+@end
+
+@implementation Foo
+- (void) foo
+{
+  SEL a = @selector(b1ar); 
+  a = @selector(b1ar); 
+  a = @selector(bar);
+  a = @selector(ok);   // expected-warning {{unimplemented selector 'ok'}}
+  a = @selector(ok);
+  a = @selector(NotOK);        // expected-warning {{unimplemented selector 'NotOK'}}
+  a = @selector(NotOK);
+
+  a = @selector(clNotOk);      // expected-warning {{unimplemented selector 'clNotOk'}}
+
+  a = @selector (cl1);
+  a = @selector (cl2);
+  a = @selector (instNotOk);   // expected-warning {{unimplemented selector 'instNotOk'}}
+}
+@end
diff --git a/test/PCH/selector-warning.m b/test/PCH/selector-warning.m
new file mode 100644 (file)
index 0000000..413f64f
--- /dev/null
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -x objective-c -emit-pch -o %t.h.pch %S/selector-warning.h
+// RUN: %clang_cc1 -include-pch %t.h.pch %s
+
+@interface Bar 
++ (void) clNotOk;
+- (void) instNotOk;
++ (void) cl1;
+@end
+
+@implementation Bar
+- (void) bar {}
++ (void) cl1 {}
++ (void) cl2 {}
+@end
+
+@implementation Bar(CAT)
+- (void) b1ar {}
+@end
+