summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGenObjC/interface-tu-variable.m24
-rw-r--r--clang/test/SemaObjC/interface-tu-variable.m21
2 files changed, 21 insertions, 24 deletions
diff --git a/clang/test/CodeGenObjC/interface-tu-variable.m b/clang/test/CodeGenObjC/interface-tu-variable.m
deleted file mode 100644
index 423a05f6dbc..00000000000
--- a/clang/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/clang/test/SemaObjC/interface-tu-variable.m b/clang/test/SemaObjC/interface-tu-variable.m
new file mode 100644
index 00000000000..f9929964d3b
--- /dev/null
+++ b/clang/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;
+}
+
OpenPOWER on IntegriCloud