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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.dg/] [vmx/] [varargs-3.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
#include "harness.h"
2
#include <stdarg.h>
3
 
4
typedef struct n_a
5
{
6
  signed char m1;
7
  short m2;
8
  int m3;
9
  double m4;
10
  vector float m5;
11
}
12
n_a;
13
 
14
void
15
varlistn_a(signed char p1, va_list ap)
16
{
17
  n_a q;
18
  q.m1 = p1;
19
  q.m2 = va_arg(ap, int);
20
  q.m3 = va_arg(ap, int);
21
  q.m4 = va_arg(ap, double);
22
  q.m5 = va_arg(ap, vector float);
23
 
24
  check(q.m1 == 77, "q.m1");
25
  check(q.m2 == 1924, "q.m2");
26
  check(q.m3 == -1471601920, "q.m3");
27
  check(q.m4 == 3.65e+18, "q.m4");
28
  check(vec_all_eq(q.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})), "q.m5");
29
}
30
 
31
void
32
varargsn_a(signed char p1, ...)
33
{
34
  n_a r, s;
35
  va_list ap;
36
 
37
  va_start(ap, p1);
38
  r.m1 = p1;
39
  r.m2 = va_arg(ap, int);
40
  r.m3 = va_arg(ap, int);
41
  r.m4 = va_arg(ap, double);
42
  r.m5 = va_arg(ap, vector float);
43
  va_end(ap);
44
 
45
  check(r.m1 == 77, "r.m1");
46
  check(r.m2 == 1924, "r.m2");
47
  check(r.m3 == -1471601920, "r.m3");
48
  check(r.m4 == 3.65e+18, "r.m4");
49
  check(vec_all_eq(r.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})), "r.m5");
50
 
51
  va_start(ap, p1);
52
  s.m1 = p1;
53
  s.m2 = va_arg(ap, int);
54
  s.m3 = va_arg(ap, int);
55
  s.m4 = va_arg(ap, double);
56
  s.m5 = va_arg(ap, vector float);
57
  va_end(ap);
58
 
59
  check(s.m1 == 77, "s.m1");
60
  check(s.m2 == 1924, "s.m2");
61
  check(s.m3 == -1471601920, "s.m3");
62
  check(s.m4 == 3.65e+18, "s.m4");
63
  check(vec_all_eq(s.m5, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08})), "s.m5");
64
 
65
  va_start(ap, p1);
66
  varlistn_a(p1, ap);
67
  va_end(ap);
68
}
69
 
70
 
71
 
72
void test()
73
{
74
  varargsn_a(77, 1924, -1471601920, 3.65e+18, ((vector float){-1.38e+09, 5.96e+08, 6.88e+08, -3.2e+08}));
75
}

powered by: WebSVN 2.1.0

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