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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vmx/] [varargs-5.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 "harness.h"
2
#include <stdarg.h>
3
 
4
typedef struct n025
5
{
6
  int m1;
7
  double m2;
8
  int m3;
9
  vector signed int m4;
10
}
11
n025;
12
 
13
static void
14
varlistn025(int p1, double p2, va_list ap)
15
{
16
  n025 q;
17
  q.m1 = p1;
18
  q.m2 = p2;
19
  q.m3 = va_arg(ap, int);
20
  q.m4 = va_arg(ap, vector signed int);
21
 
22
  check(q.m1 == 1363477585, "q.m1");
23
  check(q.m2 == -8.72e+18, "q.m2");
24
  check(q.m3 == 198652649, "q.m3");
25
  check(vec_all_eq(q.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
26
        "q.m5");
27
}
28
 
29
 
30
void
31
varargsn025(int p1, double p2, ...)
32
{
33
  n025 r, s;
34
  va_list ap;
35
 
36
  va_start(ap, p2);
37
  r.m1 = p1;
38
  r.m2 = p2;
39
  r.m3 = va_arg(ap, int);
40
  r.m4 = va_arg(ap, vector signed int);
41
  va_end(ap);
42
 
43
  check(r.m1 == 1363477585, "r.m1");
44
  check(r.m2 == -8.72e+18, "r.m2");
45
  check(r.m3 == 198652649, "r.m3");
46
  check(vec_all_eq(r.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
47
        "r.m5");
48
 
49
  va_start(ap, p2);
50
  s.m1 = p1;
51
  s.m2 = p2;
52
  s.m3 = va_arg(ap, int);
53
  s.m4 = va_arg(ap, vector signed int);
54
  va_end(ap);
55
 
56
  check(s.m1 == 1363477585, "s.m1");
57
  check(s.m2 == -8.72e+18, "s.m2");
58
  check(s.m3 == 198652649, "s.m3");
59
  check(vec_all_eq(s.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
60
        "s.m5");
61
 
62
  va_start(ap, p2);
63
  varlistn025(p1, p2, ap);
64
  va_end(ap);
65
}
66
 
67
static void test()
68
{
69
  varargsn025(1363477585, -8.72e+18, 198652649,
70
              ((vector signed int){323001541, -1353029458, 1756879633, -327031280}));
71
}

powered by: WebSVN 2.1.0

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