summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vmx/varargs-5.c
blob: ed551c2dfa93591b292ea82b24f9213c02c2282e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#include "harness.h"
#include <stdarg.h>

typedef struct n025
{
  int m1;
  double m2;
  int m3;
  vector signed int m4;
}
n025;

static void
varlistn025(int p1, double p2, va_list ap)
{
  n025 q;
  q.m1 = p1;
  q.m2 = p2;
  q.m3 = va_arg(ap, int);
  q.m4 = va_arg(ap, vector signed int);

  check(q.m1 == 1363477585, "q.m1");
  check(q.m2 == -8.72e+18, "q.m2");
  check(q.m3 == 198652649, "q.m3");
  check(vec_all_eq(q.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
	"q.m5");
}


void
varargsn025(int p1, double p2, ...)
{
  n025 r, s;
  va_list ap;

  va_start(ap, p2);
  r.m1 = p1;
  r.m2 = p2;
  r.m3 = va_arg(ap, int);
  r.m4 = va_arg(ap, vector signed int);
  va_end(ap);

  check(r.m1 == 1363477585, "r.m1");
  check(r.m2 == -8.72e+18, "r.m2");
  check(r.m3 == 198652649, "r.m3");
  check(vec_all_eq(r.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
	"r.m5");

  va_start(ap, p2);
  s.m1 = p1;
  s.m2 = p2;
  s.m3 = va_arg(ap, int);
  s.m4 = va_arg(ap, vector signed int);
  va_end(ap);

  check(s.m1 == 1363477585, "s.m1");
  check(s.m2 == -8.72e+18, "s.m2");
  check(s.m3 == 198652649, "s.m3");
  check(vec_all_eq(s.m4, ((vector signed int){323001541, -1353029458, 1756879633, -327031280})),
	"s.m5");

  va_start(ap, p2);
  varlistn025(p1, p2, ap);
  va_end(ap);
}

static void test()
{
  varargsn025(1363477585, -8.72e+18, 198652649,
	      ((vector signed int){323001541, -1353029458, 1756879633, -327031280}));
}