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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gfortran.dg/] [gnu_logical_1.F] - Blame information for rev 154

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

Line No. Rev Author Line
1 149 jeremybenn
! Testcases for the AND, OR and XOR functions (GNU intrinsics).
2
! { dg-do run }
3
! { dg-options "-ffixed-line-length-none" }
4
      integer(kind=1) i1, j1
5
      integer(kind=2) i2, j2
6
      integer         i4, j4
7
      integer(kind=8) i8, j8
8
      logical(kind=1) l1, k1
9
      logical(kind=2) l2, k2
10
      logical         l4, k4
11
      logical(kind=8) l8, k8
12
 
13
#define TEST_INTEGER(u,ukind,v,vkind) \
14
      ukind = u;\
15
      vkind = v;\
16
      if (iand(u,v) /= and(ukind, vkind)) call abort;\
17
      if (iand(u,v) /= and(vkind, ukind)) call abort;\
18
      if (ieor(u,v) /= xor(ukind, vkind)) call abort;\
19
      if (ieor(u,v) /= xor(vkind, ukind)) call abort;\
20
      if (ior(u,v) /= or(ukind, vkind)) call abort;\
21
      if (ior(u,v) /= or(vkind, ukind)) call abort
22
 
23
      TEST_INTEGER(19,i1,6,j1)
24
      TEST_INTEGER(19,i1,6,j2)
25
      TEST_INTEGER(19,i1,6,j4)
26
      TEST_INTEGER(19,i1,6,j8)
27
 
28
      TEST_INTEGER(19,i2,6,j1)
29
      TEST_INTEGER(19,i2,6,j2)
30
      TEST_INTEGER(19,i2,6,j4)
31
      TEST_INTEGER(19,i2,6,j8)
32
 
33
      TEST_INTEGER(19,i4,6,j1)
34
      TEST_INTEGER(19,i4,6,j2)
35
      TEST_INTEGER(19,i4,6,j4)
36
      TEST_INTEGER(19,i4,6,j8)
37
 
38
      TEST_INTEGER(19,i8,6,j1)
39
      TEST_INTEGER(19,i8,6,j2)
40
      TEST_INTEGER(19,i8,6,j4)
41
      TEST_INTEGER(19,i8,6,j8)
42
 
43
 
44
 
45
#define TEST_LOGICAL(u,ukind,v,vkind) \
46
      ukind = u;\
47
      vkind = v;\
48
      if ((u .and. v) .neqv. and(ukind, vkind)) call abort;\
49
      if ((u .and. v) .neqv. and(vkind, ukind)) call abort;\
50
      if (((u .and. .not. v) .or. (.not. u .and. v)) .neqv. xor(ukind, vkind)) call abort;\
51
      if (((u .and. .not. v) .or. (.not. u .and. v)) .neqv. xor(vkind, ukind)) call abort;\
52
      if ((u .or. v) .neqv. or(ukind, vkind)) call abort;\
53
      if ((u .or. v) .neqv. or(vkind, ukind)) call abort
54
 
55
      TEST_LOGICAL(.true.,l1,.false.,k1)
56
      TEST_LOGICAL(.true.,l1,.true.,k1)
57
      TEST_LOGICAL(.true.,l1,.false.,k2)
58
      TEST_LOGICAL(.true.,l1,.true.,k2)
59
      TEST_LOGICAL(.true.,l1,.false.,k4)
60
      TEST_LOGICAL(.true.,l1,.true.,k4)
61
      TEST_LOGICAL(.true.,l1,.false.,k8)
62
      TEST_LOGICAL(.true.,l1,.true.,k8)
63
 
64
      TEST_LOGICAL(.true.,l2,.false.,k1)
65
      TEST_LOGICAL(.true.,l2,.true.,k1)
66
      TEST_LOGICAL(.true.,l2,.false.,k2)
67
      TEST_LOGICAL(.true.,l2,.true.,k2)
68
      TEST_LOGICAL(.true.,l2,.false.,k4)
69
      TEST_LOGICAL(.true.,l2,.true.,k4)
70
      TEST_LOGICAL(.true.,l2,.false.,k8)
71
      TEST_LOGICAL(.true.,l2,.true.,k8)
72
 
73
      TEST_LOGICAL(.true.,l4,.false.,k1)
74
      TEST_LOGICAL(.true.,l4,.true.,k1)
75
      TEST_LOGICAL(.true.,l4,.false.,k2)
76
      TEST_LOGICAL(.true.,l4,.true.,k2)
77
      TEST_LOGICAL(.true.,l4,.false.,k4)
78
      TEST_LOGICAL(.true.,l4,.true.,k4)
79
      TEST_LOGICAL(.true.,l4,.false.,k8)
80
      TEST_LOGICAL(.true.,l4,.true.,k8)
81
 
82
      TEST_LOGICAL(.true.,l8,.false.,k1)
83
      TEST_LOGICAL(.true.,l8,.true.,k1)
84
      TEST_LOGICAL(.true.,l8,.false.,k2)
85
      TEST_LOGICAL(.true.,l8,.true.,k2)
86
      TEST_LOGICAL(.true.,l8,.false.,k4)
87
      TEST_LOGICAL(.true.,l8,.true.,k4)
88
      TEST_LOGICAL(.true.,l8,.false.,k8)
89
      TEST_LOGICAL(.true.,l8,.true.,k8)
90
 
91
      end

powered by: WebSVN 2.1.0

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