llvm-project
36 строк · 743.0 Байт
1//
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
5
6/*
7* cast.c
8* testObjects
9*
10* Created by Blaine Garst on 2/17/09.
11*
12*/
13
14// PURPOSE should allow casting of a Block reference to an arbitrary pointer and back
15// CONFIG open
16
17#include <stdio.h>
18
19
20
21int main(int argc, char *argv[]) {
22
23void (^aBlock)(void);
24int *ip;
25char *cp;
26double *dp;
27
28ip = (int *)aBlock;
29cp = (char *)aBlock;
30dp = (double *)aBlock;
31aBlock = (void (^)(void))ip;
32aBlock = (void (^)(void))cp;
33aBlock = (void (^)(void))dp;
34printf("%s: success", argv[0]);
35return 0;
36}
37