1 /* FIXME: Run this test with the GNU runtime as well. */
2 /* { dg-do compile { target *-*-darwin* } } */
3 /* { dg-skip-if "" { *-*-* } { "-fgnu-runtime" } { "" } } */
4 /* { dg-skip-if "No NeXT fast enum. pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */
5 /* { dg-additional-options "-framework Foundation" { target { *-*-darwin* } } } */
7 #include <Foundation/NSArray.h>
8 #include <Foundation/NSAutoreleasePool.h>
10 NSArray * createTestVictim(unsigned capacity) {
11 NSMutableArray * arr = [[NSMutableArray alloc] initWithCapacity:capacity];
14 for(x = 0; x < capacity; x++) {
15 NSNumber * num = [NSNumber numberWithInteger:x];
19 NSArray * immutableCopy = [arr copy];
25 void addStuffUp(NSArray * values) {
26 NSInteger accumulator = 0;
27 // for (id item in values) {
29 for (item in values) {
30 accumulator += [item integerValue];
34 int main (int argc, char const* argv[]) {
35 NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
36 NSArray * target = createTestVictim(10);
41 /* { dg-final { scan-assembler "_addStuffUp:" } } */