summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/nios2/nios2-stxio.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.target/nios2/nios2-stxio.c')
-rw-r--r--gcc/testsuite/gcc.target/nios2/nios2-stxio.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/nios2/nios2-stxio.c b/gcc/testsuite/gcc.target/nios2/nios2-stxio.c
new file mode 100644
index 00000000000..af079d641c7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/nios2/nios2-stxio.c
@@ -0,0 +1,25 @@
+/* { dg-do compile } */
+
+void test_stbio (unsigned char* p1, unsigned char* p2)
+{
+ __builtin_stbio (p1, *p2);
+ __builtin_stbio (p2, 0);
+ __builtin_stbio (p2 + 1, 0x80);
+ __builtin_stbio (p2 + 2, 0x7f);
+}
+
+void test_sthio (unsigned short* p1, unsigned short* p2)
+{
+ __builtin_sthio (p1, *p2);
+ __builtin_sthio (p2, 0);
+ __builtin_sthio (p2 + 1, 0x8000);
+ __builtin_sthio (p2 + 2, 0x7fff);
+}
+
+void test_stwio (unsigned int* p1, unsigned int* p2)
+{
+ __builtin_stwio (p1, *p2);
+ __builtin_stwio (p2, 0);
+ __builtin_stwio (p2 + 1, 0x80000000);
+ __builtin_stwio (p2 + 2, 0x7fffffff);
+}