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
6 // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*-
18 int main (int argc
, const char * argv
[]) {
21 MiniStruct (^copyStruct
)(MiniStruct
);
23 memset(&inny
, 0xA5, sizeof(inny
));
24 memset(&outty
, 0x2A, sizeof(outty
));
29 copyStruct
= ^(MiniStruct aTinyStruct
){ return aTinyStruct
; }; // pass-by-value intrinsically copies the argument
31 outty
= copyStruct(inny
);
33 if ( &inny
== &outty
) {
34 printf("%s: struct wasn't copied.", argv
[0]);
37 if ( (inny
.a
!= outty
.a
) || (inny
.b
!= outty
.b
) ) {
38 printf("%s: struct contents did not match.", argv
[0]);
42 printf("%s: success\n", argv
[0]);