| 1 |
/* Test for proper handling of volatile parameters in ObjC methods. */ |
| 2 |
/* Contributed by Ziemowit Laski <[email protected]> */ |
| 3 |
/* { dg-do compile } */ |
| 4 |
/* { dg-options "-O2" } */ |
| 5 |
/* { dg-additional-options "-Wno-objc-root-class" } */ |
| 6 |
|
| 7 |
@interface Test |
| 8 |
-(void) test2: (volatile int) a; |
| 9 |
@end |
| 10 |
|
| 11 |
@implementation Test |
| 12 |
-(void) test2: (volatile int) a |
| 13 |
{ |
| 14 |
/* The following assignment should NOT be optimized away. */ |
| 15 |
a = 1; |
| 16 |
} |
| 17 |
@end |
| 18 |
|
| 19 |
/* { dg-final { scan-assembler "li r\[0-9\]+,1" { target powerpc*-*-darwin* } } } */ |