forked from gsvgit/Brahma.FSharp
/
Union.Compile.Test7.cl
25 lines (25 loc) · 1.42 KB
/
Union.Compile.Test7.cl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
typedef struct TranslateMatchTestUnion {int tag ;
union TranslateMatchTestUnion_Data {struct Case2Type {int
Item ;}
Case2 ;
struct Case3Type {int
Item1
;
int
Item2
;}
Case3 ;} data ;} TranslateMatchTestUnion
;
__kernel void brahmaKernel ()
{TranslateMatchTestUnion t = { 0 } ;
int m = 5 ;
if (((t) . tag == 1))
{int x = (((t) . data) . Case2) . Item ;
m = x ;}
else
{if (((t) . tag == 2))
{int z = (((t) . data) . Case3) . Item2 ;
int y = (((t) . data) . Case3) . Item1 ;
m = (y + z) ;}
else
{m = 5 ;} ;} ;}