summaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/cris/c/writev1.c
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2008-12-30 13:57:11 +0000
committerHans-Peter Nilsson <hp@axis.com>2008-12-30 13:57:11 +0000
commitfe524faa87338b3324439dadbaf6afa3734312d5 (patch)
tree1be71131138ede993cd65234bea45d8664cd1dd5 /sim/testsuite/sim/cris/c/writev1.c
parentc06ccdf1b680092e01cba0af3681c12bf63d2ed0 (diff)
downloadbinutils-gdb-fe524faa87338b3324439dadbaf6afa3734312d5.tar.gz
* sim/cris/asm/badarch1.ms, sim/cris/c/badldso1.c,
sim/cris/c/badldso2.c, sim/cris/c/badldso3.c, sim/cris/c/helloaout.c, sim/cris/c/hellodyn.c, sim/cris/c/hellodyn2.c, sim/cris/c/writev1.c, sim/cris/c/writev2.c: New tests. * sim/cris/c/c.exp: If compiler links libc.so when attempting to link dynamically, create symlink named "lib" to the directory where it is found. Handle new test-case option "dynamic".
Diffstat (limited to 'sim/testsuite/sim/cris/c/writev1.c')
-rw-r--r--sim/testsuite/sim/cris/c/writev1.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/sim/testsuite/sim/cris/c/writev1.c b/sim/testsuite/sim/cris/c/writev1.c
new file mode 100644
index 00000000000..fad5b7f1920
--- /dev/null
+++ b/sim/testsuite/sim/cris/c/writev1.c
@@ -0,0 +1,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;
+}