OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vmx/] [1c-01.c] - Blame information for rev 801

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
#include <stddef.h>
2
#include "harness.h"
3
 
4
/* Declare vector types.  */
5
vector unsigned char u8;
6
vector signed char s8;
7
vector bool char b8;
8
vector unsigned short u16;
9
vector signed short s16;
10
vector bool short b16;
11
vector unsigned int u32;
12
vector signed int s32;
13
vector bool int b32;
14
vector float f32;
15
vector pixel p16;
16
 
17
vector unsigned char *u8c = &u8;
18
vector signed char *s8c = &s8;
19
vector bool char *b8c = &b8;
20
vector unsigned short *u16c = &u16;
21
vector signed short *s16c = &s16;
22
vector bool short *b16c = &b16;
23
vector unsigned int *u32c = &u32;
24
vector signed int *s32c = &s32;
25
vector bool int *b32c = &b32;
26
vector float *f32c = &f32;
27
vector pixel *p16c = &p16;
28
 
29
static void test()
30
{
31
  check(((ptrdiff_t)u8c & 15) == 0, "alignof(u8)");
32
  check(((ptrdiff_t)u8c & 15) == 0, "alignof(u8)");
33
  check(((ptrdiff_t)s8c & 15) == 0, "alignof(s8)");
34
  check(((ptrdiff_t)b8c & 15) == 0, "alignof(b8)");
35
  check(((ptrdiff_t)u16c & 15) == 0, "alignof(u16)");
36
  check(((ptrdiff_t)s16c & 15) == 0, "alignof(s16)");
37
  check(((ptrdiff_t)b16c & 15) == 0, "alignof(b16)");
38
  check(((ptrdiff_t)u32c & 15) == 0, "alignof(u32)");
39
  check(((ptrdiff_t)s32c & 15) == 0, "alignof(s32)");
40
  check(((ptrdiff_t)b32c & 15) == 0, "alignof(b32)");
41
  check(((ptrdiff_t)f32c & 15) == 0, "alignof(f32)");
42
  check(((ptrdiff_t)p16c & 15) == 0, "alignof(p16)");
43
 
44
  check((ptrdiff_t)u8c == (ptrdiff_t)&u8, "u8c == &u8");
45
  check((ptrdiff_t)u8c == (ptrdiff_t)&u8, "u8c == &u8");
46
  check((ptrdiff_t)s8c == (ptrdiff_t)&s8, "s8c == &s8");
47
  check((ptrdiff_t)b8c == (ptrdiff_t)&b8, "b8c == &b8");
48
  check((ptrdiff_t)u16c == (ptrdiff_t)&u16, "u16c == &u16");
49
  check((ptrdiff_t)s16c == (ptrdiff_t)&s16, "s16c == &s16");
50
  check((ptrdiff_t)b16c == (ptrdiff_t)&b16, "b16c == &b16");
51
  check((ptrdiff_t)u32c == (ptrdiff_t)&u32, "u32c == &u32");
52
  check((ptrdiff_t)s32c == (ptrdiff_t)&s32, "s32c == &s32");
53
  check((ptrdiff_t)b32c == (ptrdiff_t)&b32, "b32c == &b32");
54
  check((ptrdiff_t)f32c == (ptrdiff_t)&f32, "f32c == &f32");
55
  check((ptrdiff_t)p16c == (ptrdiff_t)&p16, "p16c == &p16");
56
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.