blob: f0070cbe5c9385f5b91059d21323a5d8cefe350f [file] [log] [blame]
Blaine Garst86d0ba42010-08-04 23:34:21 +00001//
2// The LLVM Compiler Infrastructure
3//
4// This file is distributed under the University of Illinois Open Source
5// License. See LICENSE.TXT for details.
6
7/*
8 * recursiveassign.c
9 * testObjects
10 *
11 * Created by Blaine Garst on 12/3/08.
12 *
13 */
14
15// CONFIG rdar://6639533
16
17// The compiler is prefetching x->forwarding before evaluting code that recomputes forwarding and so the value goes to a place that is never seen again.
18
19#include <stdio.h>
20#include <stdlib.h>
21#include <Block.h>
22
23
24int main(int argc, char* argv[]) {
25
26 __block void (^recursive_copy_block)(int) = ^(int arg) { printf("got wrong Block\n"); exit(1); };
27
28
29 recursive_copy_block = Block_copy(^(int i) {
30 if (i > 0) {
31 recursive_copy_block(i - 1);
32 }
33 else {
34 printf("done!\n");
35 }
36 });
37
38
39 recursive_copy_block(5);
40
41 printf("%s: Success\n", argv[0]);
42 return 0;
43}
44