Issue error if variables are defined inside an objc class,
category or protocol.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67450 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenObjC/interface-tu-variable.m b/test/CodeGenObjC/interface-tu-variable.m
deleted file mode 100644
index 423a05f..0000000
--- a/test/CodeGenObjC/interface-tu-variable.m
+++ /dev/null
@@ -1,24 +0,0 @@
-// RUN: clang -fnext-runtime -emit-llvm -o %t %s
-// RUN: grep 'two = global' %t &&
-// RUN: grep 'ddd = common' %t &&
-// RUN: grep 'III = common' %t
-
-@interface XX
-int x; 
-int one=1; 
-int two = 2; 
-@end
-
-@protocol PPP
-int ddd;
-@end
-
-@interface XX(CAT)
-  char * III;
-@end
-
-
-int main( int argc, const char *argv[] ) {
-    return x+one+two;
-}
-
diff --git a/test/SemaObjC/interface-tu-variable.m b/test/SemaObjC/interface-tu-variable.m
new file mode 100644
index 0000000..f992996
--- /dev/null
+++ b/test/SemaObjC/interface-tu-variable.m
@@ -0,0 +1,21 @@
+// RUN: clang -fsyntax-only -verify %s
+
+@interface XX
+int x;  // expected-error {{cannot declare variable inside a class, protocol or category}}
+int one=1;  // expected-error {{cannot declare variable inside a class, protocol or category}}
+@end
+
+@protocol PPP
+int ddd; // expected-error {{cannot declare variable inside a class, protocol or category}}
+@end
+
+@interface XX(CAT)
+  char * III; // expected-error {{cannot declare variable inside a class, protocol or category}}
+  extern int OK;
+@end
+
+
+int main( int argc, const char *argv[] ) {
+    return x+one;
+}
+