| 1 |
/* All calls must be properly stubified. */ |
| 2 |
/* Testcase extracted from TextEdit:Document.m. */ |
| 3 |
|
| 4 |
/* { dg-do compile { target *-*-darwin* } } */ |
| 5 |
/* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */ |
| 6 |
/* { dg-require-effective-target ilp32 } */ |
| 7 |
/* { dg-options "-mdynamic-no-pic -fdump-rtl-jump -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 |
extern id objc_msgSend(id self, char * op, ...); |
| 13 |
extern int bogonic (int, int, int) ; |
| 14 |
@interface Document {} |
| 15 |
- (Document *) window; |
| 16 |
- (Document *) class; |
| 17 |
- (Document *) close; |
| 18 |
@end |
| 19 |
@implementation Document |
| 20 |
- (Document *) class { return (Document *)0; } |
| 21 |
- (Document *) close { return (Document *)0; } |
| 22 |
- (Document *) window { return (Document *)0; } |
| 23 |
- (void)willEndCloseSheet:(void *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo { |
| 24 |
[[self window] close]; |
| 25 |
((void (*)(id, char *, int))objc_msgSend)([self class], (char *)contextInfo, 1); |
| 26 |
((void (*)(id, char *, int))bogonic)([self class], (char *)contextInfo, 1); |
| 27 |
bogonic (3, 4, 5); |
| 28 |
x++; |
| 29 |
} |
| 30 |
@end |
| 31 |
|
| 32 |
/* Any symbol_ref of an un-stubified objc_msgSend is an error; look |
| 33 |
for "objc_msgSend" in quotes, without the $stub suffix. */ |
| 34 |
/* { dg-final { scan-rtl-dump-not {symbol_ref.*"objc_msgSend"} "jump" { target powerpc*-*-darwin* } } } */ |
| 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]+_Z7bogoniciii\n} } } */ |
| 39 |
/* { dg-final { scan-assembler {(bl|call)[ \t]+L__Z7bogoniciii\$stub\n} } } */ |
| 40 |
/* { dg-final { scan-assembler-not {\$non_lazy_ptr} } } */ |