Add some Objective-C code generation tests.
- Note that these don't really test anything other than that code
generation doesn't fail or crash. Better than nothing though!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55761 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/CodeGenObjC/messages.m b/test/CodeGenObjC/messages.m
new file mode 100644
index 0000000..fab3c5d
--- /dev/null
+++ b/test/CodeGenObjC/messages.m
@@ -0,0 +1,21 @@
+// RUN: clang -fnext-runtime --emit-llvm -o %t %s
+
+typedef struct {
+ int x;
+ int y;
+ int z[10];
+} MyPoint;
+
+void f0(id a) {
+ int i;
+ MyPoint pt = { 1, 2};
+
+ [a print0];
+ [a print1: 10];
+ [a print2: 10 and: "hello" and: 2.2];
+ [a takeStruct: pt ];
+
+ void *s = @selector(print0);
+ for (i=0; i<2; ++i)
+ [a performSelector:s];
+}