2 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 // See https://llvm.org/LICENSE.txt for license information.
4 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
10 * Created by Blaine Garst on 9/30/08.
14 #include <Block_private.h>
19 int main(int argc
, char *argv
[]) {
24 } localStuff
= { 10, 20, 30 };
27 void (^a
)(void) = ^ { printf("d is %d", d
); };
28 void (^b
)(void) = ^ { printf("d is %d, localStuff.a is %lu", d
, localStuff
.a
); };
30 unsigned nominalsize
= Block_size(b
) - Block_size(a
);
32 // need copy+dispose helper for C++ structures
33 nominalsize
+= 2*sizeof(void*);
35 if ((Block_size(b
) - Block_size(a
)) != nominalsize
) {
36 printf("sizeof a is %ld, sizeof b is %ld, expected %d\n", Block_size(a
), Block_size(b
), nominalsize
);
37 printf("dump of b is %s\n", _Block_dump(b
));
40 printf("%s: Success\n", argv
[0]);