summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenObjC
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-02-22 01:23:29 +0000
committerAnders Carlsson <andersca@mac.com>2011-02-22 01:23:29 +0000
commit4fc229ef6919b7e88e8b05623f8584385392d990 (patch)
tree223928e50b37f7adb72dffce45a4b9b5060b0099 /clang/test/CodeGenObjC
parent23eb9f707bf66797f9bd435a411a7e2fde3be4a7 (diff)
downloadbcm5719-llvm-4fc229ef6919b7e88e8b05623f8584385392d990.tar.gz
bcm5719-llvm-4fc229ef6919b7e88e8b05623f8584385392d990.zip
Move some Objective-C tests to SemaObjC and CodeGenObjC.
llvm-svn: 126175
Diffstat (limited to 'clang/test/CodeGenObjC')
-rw-r--r--clang/test/CodeGenObjC/2008-08-25-incompatible-cond-expr.m10
-rw-r--r--clang/test/CodeGenObjC/2009-01-21-invalid-debug-info.m16
-rw-r--r--clang/test/CodeGenObjC/2010-02-09-DbgSelf.m14
-rw-r--r--clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m15
-rw-r--r--clang/test/CodeGenObjC/function-decay.m10
-rw-r--r--clang/test/CodeGenObjC/illegal-UTF8.m6
-rw-r--r--clang/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m10
7 files changed, 81 insertions, 0 deletions
diff --git a/clang/test/CodeGenObjC/2008-08-25-incompatible-cond-expr.m b/clang/test/CodeGenObjC/2008-08-25-incompatible-cond-expr.m
new file mode 100644
index 00000000000..f285cca094e
--- /dev/null
+++ b/clang/test/CodeGenObjC/2008-08-25-incompatible-cond-expr.m
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -emit-llvm -o %t %s
+
+@protocol P0
+@end
+@interface A <P0>
+@end
+
+id f0(int a, id<P0> x, A* p) {
+ return a ? x : p;
+}
diff --git a/clang/test/CodeGenObjC/2009-01-21-invalid-debug-info.m b/clang/test/CodeGenObjC/2009-01-21-invalid-debug-info.m
new file mode 100644
index 00000000000..af912e2dc54
--- /dev/null
+++ b/clang/test/CodeGenObjC/2009-01-21-invalid-debug-info.m
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -S -g -o %t.s %s
+
+// FIXME: This test case can be removed at some point (since it will
+// no longer effectively test anything). The reason it was causing
+// trouble was the synthesized self decl in im1 was causing the debug
+// info for I1* to be generated, but referring to an invalid compile
+// unit. This was later referred to by f1 and created ill formed debug
+// information.
+
+@interface I1 @end
+
+@implementation I1
+-im0 { return 0; }
+@end
+
+I1 *f1(void) { return 0; }
diff --git a/clang/test/CodeGenObjC/2010-02-09-DbgSelf.m b/clang/test/CodeGenObjC/2010-02-09-DbgSelf.m
new file mode 100644
index 00000000000..e09adac161e
--- /dev/null
+++ b/clang/test/CodeGenObjC/2010-02-09-DbgSelf.m
@@ -0,0 +1,14 @@
+// RUN: %clang_cc1 -x objective-c -emit-llvm -g < %s | grep "\"self\", metadata"
+// Test to check that "self" argument is assigned a location.
+
+@interface Foo
+-(void) Bar: (int)x ;
+@end
+
+
+@implementation Foo
+-(void) Bar: (int)x
+{
+}
+@end
+
diff --git a/clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m b/clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m
new file mode 100644
index 00000000000..5186b20310a
--- /dev/null
+++ b/clang/test/CodeGenObjC/2010-02-15-Dbg-MethodStart.m
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -x objective-c -emit-llvm -g < %s | grep subprogram | grep "i32 9"
+// Test to check that subprogram start location.
+
+@interface Foo
+-(int) barMethod;
+@end
+
+@implementation Foo
+-(int) barMethod {
+ int i = 0;
+ int j = 1;
+ int k = 1;
+ return i + j + k;
+}
+@end
diff --git a/clang/test/CodeGenObjC/function-decay.m b/clang/test/CodeGenObjC/function-decay.m
new file mode 100644
index 00000000000..161f9079b25
--- /dev/null
+++ b/clang/test/CodeGenObjC/function-decay.m
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 %s -emit-llvm -o -
+
+@interface I0 @end
+@implementation I0
+- (void) im0: (int (void)) a0 {
+}
+@end
+
+void func(int pf(void)) {
+}
diff --git a/clang/test/CodeGenObjC/illegal-UTF8.m b/clang/test/CodeGenObjC/illegal-UTF8.m
new file mode 100644
index 00000000000..4762e800259
--- /dev/null
+++ b/clang/test/CodeGenObjC/illegal-UTF8.m
@@ -0,0 +1,6 @@
+// RUN: %clang %s -S -m64 -o -
+
+@class NSString;
+
+
+NSString *S = @"\xff\xff___WAIT___"; // expected-warning {{input conversion stopped due to an input byte that does not belong to the input codeset UTF-8}}
diff --git a/clang/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m b/clang/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m
new file mode 100644
index 00000000000..b4d21a3f8fc
--- /dev/null
+++ b/clang/test/CodeGenObjC/rdr-6732143-dangling-block-reference.m
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -emit-llvm %s -o -
+
+void f0(id x) {
+ @synchronized (x) {
+ do { ; } while(0);
+ @try {
+ } @finally {
+ }
+ }
+}
OpenPOWER on IntegriCloud