PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / obj-c++.dg / stubify-1.mm
blob687739ceccd9dffd73158f0ff81f442c1618d0dc
1 /* All calls must be properly stubified.  Complain about any "call
2    _objc_msgSend<end-of-line>" without the $stub suffix.  */
4 /* { dg-do compile { target *-*-darwin* } } */
5 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
6 /* { dg-require-effective-target ilp32 } */
7 /* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4" } */
9 typedef struct objc_object { } *id ;
10 int x = 41 ;
12 extern "C" {
13   extern id objc_msgSend(id self, char * op, ...);
14   extern int bogonic (int, int, int);
17 @interface Document {}
18 - (Document *) window;
19 - (Document *) class;
20 - (Document *) close;
21 @end
22 @implementation Document
23 - (Document *) class { }
24 - (Document *) close { }
25 - (Document *) window { }
26 - (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
27   [[self window] close];
28   ((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1);
29   ((void (*)(id, char *, int))bogonic)([self class], (char *)contextInfo, 1);
30   bogonic (3, 4, 5);
31   x++;
33 @end
35 /* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_objc_msgSend\n" } } */
36 /* { dg-final { scan-assembler     "\(bl|call\)\[ \t\]+L_objc_msgSend\\\$stub\n" } } */
37 /* { dg-final { scan-assembler-not "\(bl|call\)\[ \t\]+_bogonic\n" } } */
38 /* { dg-final { scan-assembler     "\(bl|call\)\[ \t\]+L_bogonic\\\$stub\n" } } */
39 /* { dg-final { scan-assembler-not "\\\$non_lazy_ptr" } } */