OSDN Git Service

2005-10-22 David Ayers <d.ayers@inode.at>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / obj-c++.dg / stubify-1.mm
1 /* All calls must be properly stubified.  Complain about any "call
2    _objc_msgSend<end-of-line>" without the $stub suffix.  */
3
4 /* { dg-do compile { target *-*-darwin* } } */
5 /* { dg-options "-Os -mdynamic-no-pic -fno-exceptions" } */
6
7 typedef struct objc_object { } *id ;
8 int x = 41 ;
9
10 extern "C" {
11   extern id objc_msgSend(id self, char * op, ...);
12   extern int bogonic (int, int, int);
13 }
14
15 @interface Document {}
16 - (Document *) window;
17 - (Document *) class;
18 - (Document *) close;
19 @end
20 @implementation Document
21 - (Document *) class { }
22 - (Document *) close { }
23 - (Document *) window { }
24 - (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
25   [[self window] close];
26   ((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1);
27   ((void (*)(id, char *, int))bogonic)([self class], (char *)contextInfo, 1);
28   bogonic (3, 4, 5);
29   x++;
30 }
31 @end
32
33 /* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_objc_msgSend\n" } } */
34 /* { dg-final { scan-assembler     "\(bl|call\)\[ \t\]+L_objc_msgSend\\\$stub\n" } } */
35 /* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_bogonic\n" } } */
36 /* { dg-final { scan-assembler     "\(bl|call\)\[ \t\]+L_bogonic\\\$stub\n" } } */
37 /* { dg-final { scan-assembler-not "\\\$non_lazy_ptr" } } */