[ASan/Win] Use clang rather than clang-cl by default for lit tests. Make Windows...
[blocksruntime.git] / test / BlocksRuntime / structmember.c
blobc451d3f348c93928516b240a19980ce54446e23b
1 //
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.
7 /*
8 * structmember.c
9 * testObjects
11 * Created by Blaine Garst on 9/30/08.
12 * CONFIG
14 #include <Block.h>
15 #include <Block_private.h>
16 #include <stdio.h>
18 // CONFIG
20 int main(int argc, char *argv[]) {
21 struct stuff {
22 long int a;
23 long int b;
24 long int c;
25 } localStuff = { 10, 20, 30 };
26 int d;
28 void (^a)(void) = ^ { printf("d is %d", d); };
29 void (^b)(void) = ^ { printf("d is %d, localStuff.a is %lu", d, localStuff.a); };
31 unsigned nominalsize = Block_size(b) - Block_size(a);
32 #if __cplusplus__
33 // need copy+dispose helper for C++ structures
34 nominalsize += 2*sizeof(void*);
35 #endif
36 if ((Block_size(b) - Block_size(a)) != nominalsize) {
37 printf("sizeof a is %ld, sizeof b is %ld, expected %d\n", Block_size(a), Block_size(b), nominalsize);
38 printf("dump of b is %s\n", _Block_dump(b));
39 return 1;
41 printf("%s: Success\n", argv[0]);
42 return 0;