Daily bump.
[gcc.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-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
6 /* { dg-require-effective-target ilp32 } */
7 /* { dg-options "-Os -mdynamic-no-pic -fno-exceptions -mmacosx-version-min=10.4 -msymbol-stubs" } */
8 // { dg-additional-options "-Wno-objc-root-class" }
9
10 typedef struct objc_object { } *id ;
11 int x = 41 ;
12
13 extern "C" {
14 extern id objc_msgSend(id self, objc_selector* op, ...);
15 extern int bogonic (int, int, int);
16 }
17
18 @interface Document {}
19 - (Document *) window;
20 - (Document *) class;
21 - (Document *) close;
22 @end
23 @implementation Document
24 - (Document *) class { return (Document *)0; }
25 - (Document *) close { return (Document *)0; }
26 - (Document *) window { return (Document *)0; }
27 - (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo {
28 [[self window] close];
29 ((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1);
30 ((void (*)(id, char *, int))bogonic)([self class], (char *)contextInfo, 1);
31 bogonic (3, 4, 5);
32 x++;
33 }
34 @end
35
36 /* { dg-final { scan-assembler-not {(bl|call)[ \t]+_objc_msgSend\n} } } */
37 /* { dg-final { scan-assembler {(bl|call)[ \t]+L_objc_msgSend\$stub\n} } } */
38 /* { dg-final { scan-assembler-not {(bl|call)[ \t]+_bogonic\n} } } */
39 /* { dg-final { scan-assembler {(bl|call)[ \t]+L_bogonic\$stub\n} } } */
40 /* { dg-final { scan-assembler-not {\$non_lazy_ptr} } } */