aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/cris/c/writev1.c
blob: fad5b7f1920bbed55dae5557141df341f5938db6 (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
/* Trivial test of writev.
#notarget: cris*-*-elf
#output: abcdefghijklmn\npass\n
*/
#include <sys/uio.h>
#include <stdlib.h>
#include <stdio.h>

#define X(x) {x, sizeof (x) -1}
struct iovec v[] = {
  X("a"),
  X("bcd"),
  X("efghi"),
  X("j"),
  X("klmn\n"),
};

int main (void)
{
  if (writev (1, v, sizeof v / sizeof (v[0])) != 15)
    abort ();

  printf ("pass\n");
  return 0; 
}