You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
854 B
47 lines
854 B
10 years ago
|
/*
|
||
9 years ago
|
* Copyright (c) 2014 - present Facebook, Inc.
|
||
|
* All rights reserved.
|
||
|
*
|
||
|
* This source code is licensed under the BSD style license found in the
|
||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||
|
*/
|
||
10 years ago
|
|
||
9 years ago
|
int main1(int y) {
|
||
9 years ago
|
|
||
9 years ago
|
static int s = 3;
|
||
|
int x = 7;
|
||
9 years ago
|
|
||
9 years ago
|
int add1, add2;
|
||
|
int (^addblock)(int a, int b);
|
||
9 years ago
|
|
||
9 years ago
|
addblock = ^(int c, int d) {
|
||
10 years ago
|
|
||
9 years ago
|
int (^addblock2)(int a);
|
||
|
int add2;
|
||
|
int bla = 3;
|
||
10 years ago
|
|
||
9 years ago
|
addblock2 = ^(int z) {
|
||
|
return z + s + x + bla;
|
||
10 years ago
|
};
|
||
9 years ago
|
|
||
9 years ago
|
add2 = addblock2(1);
|
||
|
return c + add2 + bla;
|
||
|
};
|
||
9 years ago
|
|
||
9 years ago
|
add1 = addblock(1, 2);
|
||
9 years ago
|
|
||
9 years ago
|
addblock = ^(int e, int f) {
|
||
|
return e - s;
|
||
|
};
|
||
10 years ago
|
|
||
9 years ago
|
add2 = addblock(3, 2);
|
||
9 years ago
|
|
||
9 years ago
|
// Here we should get a division by zero
|
||
|
y = add1 / add2;
|
||
9 years ago
|
|
||
9 years ago
|
return y;
|
||
10 years ago
|
}
|
||
|
|
||
8 years ago
|
int BlockMain() { return main1(4); }
|