aboutsummaryrefslogtreecommitdiffstats
path: root/test/C++Frontend/2003-05-23-TransparentUnion.c
blob: 870826a595aff7b4aab0eedf8447b9da4bb7c318 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>

typedef union {
  float *__fptr;
  int *__iptr;
} UNION __attribute__ ((__transparent_union__));

int try(UNION U) {
  return 1;
}
int test() {
  int I;
  float F;
  return try(&I) | try(&F);
}

int main() {
  if (test()) printf("ok");
  return 0;
}