OSDN Git Service

2010-03-25 Iain Sandoe <iain.sandoe@sandoe-acoustics.co.uk>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / stubify-1.m
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-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
6 /* { dg-options "-Os -mdynamic-no-pic" } */
7
8 typedef struct objc_object { } *id ;
9 int x = 41 ;
10 extern id objc_msgSend(id self, char * op, ...);
11 extern int bogonic (int, int, int) ;
12 @interface Document {}
13 - (Document *) window;
14 - (Document *) class;
15 - (Document *) close;
16 @end
17 @implementation Document
18 - (Document *) class { }
19 - (Document *) close { }
20 - (Document *) window { }
21 - (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
22   [[self window] close];
23   ((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1);
24   ((void (*)(id, char *, int))bogonic)([self class], (char *)contextInfo, 1);
25   bogonic (3, 4, 5);
26   x++;
27 }
28 @end
29
30 /* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_objc_msgSend\n" } } */
31 /* { dg-final { scan-assembler     "\(bl|call\)\[ \t\]+L_objc_msgSend\\\$stub\n" } } */
32 /* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_bogonic\n" } } */
33 /* { dg-final { scan-assembler     "\(bl|call\)\[ \t\]+L_bogonic\\\$stub\n" } } */
34 /* { dg-final { scan-assembler-not "\\\$non_lazy_ptr" } } */