2 // The LLVM Compiler Infrastructure
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
7 // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*-
19 int main (int argc
, const char * argv
[]) {
22 MiniStruct (^copyStruct
)(MiniStruct
);
24 memset(&inny
, 0xA5, sizeof(inny
));
25 memset(&outty
, 0x2A, sizeof(outty
));
30 copyStruct
= ^(MiniStruct aTinyStruct
){ return aTinyStruct
; }; // pass-by-value intrinsically copies the argument
32 outty
= copyStruct(inny
);
34 if ( &inny
== &outty
) {
35 printf("%s: struct wasn't copied.", argv
[0]);
38 if ( (inny
.a
!= outty
.a
) || (inny
.b
!= outty
.b
) ) {
39 printf("%s: struct contents did not match.", argv
[0]);
43 printf("%s: success\n", argv
[0]);