]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add testcases for CU21. Update opcode table.
authorFlorian Krohm <florian@eich-krohm.de>
Fri, 20 Jul 2012 00:17:16 +0000 (00:17 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Fri, 20 Jul 2012 00:17:16 +0000 (00:17 +0000)
WRT the memcheck test: the good news is we get all the complaints
we want. The bad news is:
- the line numbers from within do_cu21 are off
- there are 2 complaints when attempting to convert from
  an uninitialised input buffer instead of one. One of them has a
  completely bogus line number.

Possibly due to bad debug info?  Let's see what happens on machines
with more recent GCCs.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12765

15 files changed:
docs/internals/s390-opcodes.csv
memcheck/tests/s390x/Makefile.am
memcheck/tests/s390x/cu21.c [new file with mode: 0644]
memcheck/tests/s390x/cu21.stderr.exp [new file with mode: 0644]
memcheck/tests/s390x/cu21.stdout.exp [new file with mode: 0644]
memcheck/tests/s390x/cu21.vgtest [new file with mode: 0644]
none/tests/s390x/Makefile.am
none/tests/s390x/cu21.c [new file with mode: 0644]
none/tests/s390x/cu21.stderr.exp [new file with mode: 0644]
none/tests/s390x/cu21.stdout.exp [new file with mode: 0644]
none/tests/s390x/cu21.vgtest [new file with mode: 0644]
none/tests/s390x/cu21_1.c [new symlink]
none/tests/s390x/cu21_1.stderr.exp [new file with mode: 0644]
none/tests/s390x/cu21_1.stdout.exp [new file with mode: 0644]
none/tests/s390x/cu21_1.vgtest [new file with mode: 0644]

index 58544ac21bf9922e008eeb0bc9b54cb3cee09074..82fe33418476cfc22a69dd11a69cdf90351c615d 100644 (file)
@@ -666,7 +666,7 @@ stckf,"store clock fast",implemented,
 mvcos,"move with optional specifications",N/A,"privileged instruction"
 lptea,"load page-table-entry address",N/A,"privileged instruction"
 cu24,"convert utf-16 to utf-32","not implemented","open bugzilla"
-cu21,"convert utf-16 to utf-8","not implemented","open bugzilla"
+cu21,"convert utf-16 to utf-8",implemented
 cu42,"convert utf-32 to utf-16","not implemented","open bugzilla"
 cu41,"convert utf-32 to utf-8","not implemented","open bugzilla"
 cu12,"convert utf-8 to utf-16","not implemented","open bugzilla"
index 0cd8a98addaff9a32f4e3dd246f4d9608fcec82a..b269fea5afa936cef429af8f0585328079182fe0 100644 (file)
@@ -2,7 +2,7 @@ include $(top_srcdir)/Makefile.tool-tests.am
 
 dist_noinst_SCRIPTS = filter_stderr
 
-INSN_TESTS = cs csg cds cdsg
+INSN_TESTS = cs csg cds cdsg cu21
 
 check_PROGRAMS = $(INSN_TESTS) 
 
diff --git a/memcheck/tests/s390x/cu21.c b/memcheck/tests/s390x/cu21.c
new file mode 100644 (file)
index 0000000..526f2eb
--- /dev/null
@@ -0,0 +1,115 @@
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "../../../none/tests/s390x/opcodes.h"
+
+/* Define various input buffers. */
+
+/* U+0000 to U+007f:  Result is 1 byte for each uint16_t */
+uint16_t pattern1[] = {
+   0x0000, 0x007f,    /* corner cases */
+   0x0047, 0x0056, 0x0045, 0x0021, 0x007b, 0x003a /* misc */
+};
+
+/* U+0080 to U+07ff:  Result is 2 bytes for each uint16_t */
+uint16_t pattern2[] = {
+   0x0080, 0x07ff,    /* corner cases */
+   0x07df, 0x008f, 0x0100, 0x017f, 0x052f, 0x0600, 0x06ff /* misc */
+};
+
+/* U+0800 to U+d7ff:  Result is 3 bytes for each uint16_t
+   U+dc00 to U+ffff:  Result is 3 bytes for each uint16_t */
+uint16_t pattern3[] = {
+   0x0800, 0xd7ff,    /* corner cases */
+   0xdc00, 0xffff,    /* corner cases */
+   0x083f, 0x1a21, 0x1b10, 0x2200, 0x225e, 0x22c9, 0xe001  /* misc */
+};
+
+/* U+d800 to U+dbff:  Result is 4 bytes for each uint16_t pair */
+uint16_t pattern4[] = {
+   0xd800, 0xdc00,    /* left  corner case */
+   0xdbff, 0xdfff,    /* right corner case */
+   0xdada, 0xdddd, 0xdeaf, 0xdcdc  /* misc */
+};
+
+
+void
+do_cu21(uint8_t *dst, uint64_t dst_len, uint16_t *src, uint64_t src_len)
+{
+   /* build up the register pairs */
+   register uint16_t *source     asm("4") = src;
+   register uint64_t  source_len asm("5") = src_len;
+   register uint8_t  *dest       asm("2") = dst;
+   register uint64_t  dest_len   asm("3") = dst_len;
+
+   asm volatile(
+                CU21(0,2,4)
+                : "+d"(dest), "+d"(source), "+d"(source_len), "+d"(dest_len)
+                :
+                : "memory", "cc");
+   return;
+}
+
+int main()
+{
+   /*------------------------------------------------------------*/
+   /* Write to a too small buffer                                */
+   /*------------------------------------------------------------*/
+
+   /* Write 2 bytes into buffer of length 1 */
+   do_cu21(malloc(1), 10, pattern2, 2);             // complaint (2 bytes)
+
+   /* Write 2 bytes into buffer of length 2 */
+   do_cu21(malloc(2), 10, pattern2, 2);             // no complaint
+
+   /* Write 3 bytes into buffer of length 1 */
+   do_cu21(malloc(1), 10, pattern3, 2);             // 2 complaints (3 = 2+1)
+
+   /* Write 3 bytes into buffer of length 2 */
+   do_cu21(malloc(2), 10, pattern3, 2);             // complaint (1 byte)
+
+   /* Write 3 bytes into buffer of length 3 */
+   do_cu21(malloc(3), 10, pattern3, 2);             // no complaint
+
+   /* Write 4 bytes into buffer of length 1 */
+   do_cu21(malloc(1), 10, pattern4, 4);             // complaint (4 bytes)
+
+   /* Write 4 bytes into buffer of length 2 */
+   do_cu21(malloc(2), 10, pattern4, 4);             // complaint (4 bytes)
+
+   /* Write 4 bytes into buffer of length 3 */
+   do_cu21(malloc(3), 10, pattern4, 4);             // complaint (4 bytes)
+
+   /* Write 4 bytes into buffer of length 4 */
+   do_cu21(malloc(4), 10, pattern4, 4);             // no complaint
+
+   /*------------------------------------------------------------*/
+   /* Read uninitialised data                                    */
+   /*------------------------------------------------------------*/
+   uint8_t *input = malloc(10);
+
+   /* Input buffer is completely uninitialised */
+   do_cu21(malloc(4), 4, (void *)input, 2);         // complaint
+   
+   /* Read 2 bytes from input buffer. First byte is uninitialised */
+   input = malloc(10);
+   input[0] = 0x0;
+   do_cu21(malloc(4), 4, (void *)input, 2);          // complaint
+
+   /* Read 2 bytes from input buffer. Second byte is uninitialised */
+   input = malloc(10);
+   input[1] = 0x0;
+   do_cu21(malloc(4), 4, (void *)input, 2);          // complaint
+   
+   /* Read 2 bytes from input buffer. All bytes are uninitialised */
+   input = malloc(10);
+   input[0] = input[1] = 0x0;
+   do_cu21(malloc(4), 4, (void *)input, 2);          // no complaint
+   
+   /* Write to NULL */
+   //   do_cu21(NULL, 10, pattern1, sizeof pattern1);    // complaint
+
+   return 0;
+}
diff --git a/memcheck/tests/s390x/cu21.stderr.exp b/memcheck/tests/s390x/cu21.stderr.exp
new file mode 100644 (file)
index 0000000..aef7459
--- /dev/null
@@ -0,0 +1,73 @@
+Invalid write of size 2
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:62)
+ Address 0x........ is 0 bytes inside a block of size 1 alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (cu21.c:62)
+
+Invalid write of size 2
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:68)
+ Address 0x........ is 0 bytes inside a block of size 1 alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (cu21.c:68)
+
+Invalid write of size 1
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:68)
+ Address 0x........ is 1 bytes after a block of size 1 alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (cu21.c:68)
+
+Invalid write of size 1
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:71)
+ Address 0x........ is 0 bytes after a block of size 2 alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (cu21.c:71)
+
+Invalid write of size 4
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:77)
+ Address 0x........ is 0 bytes inside a block of size 1 alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (cu21.c:77)
+
+Invalid write of size 4
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:80)
+ Address 0x........ is 0 bytes inside a block of size 2 alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (cu21.c:80)
+
+Invalid write of size 4
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:83)
+ Address 0x........ is 0 bytes inside a block of size 3 alloc'd
+   at 0x........: malloc (vg_replace_malloc.c:...)
+   by 0x........: main (cu21.c:83)
+
+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:94)
+
+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: do_cu21 (cu21.c:45)
+   by 0x........: main (cu21.c:94)
+
+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:99)
+
+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: do_cu21 (cu21.c:45)
+   by 0x........: main (cu21.c:99)
+
+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: do_cu21 (cu21.c:53)
+   by 0x........: main (cu21.c:104)
+
+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: do_cu21 (cu21.c:45)
+   by 0x........: main (cu21.c:104)
+
diff --git a/memcheck/tests/s390x/cu21.stdout.exp b/memcheck/tests/s390x/cu21.stdout.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/memcheck/tests/s390x/cu21.vgtest b/memcheck/tests/s390x/cu21.vgtest
new file mode 100644 (file)
index 0000000..10e7606
--- /dev/null
@@ -0,0 +1,2 @@
+prog: cu21
+vgopts: -q
index b74bb4b9f9f72ced56eeb6c7e25a7de285458929..62cfc83e0a5adbbef94bc10be954d81aa94ff351 100644 (file)
@@ -7,7 +7,7 @@ INSN_TESTS = clc clcle cvb cvd icm lpr tcxb lam_stam xc mvst add sub mul \
              and_EI or_EI xor_EI insert_EI mul_GE add_GE condloadstore \
              op_exception fgx stck stckf stcke stfle cksm mvcl clcl troo \
              trto trot trtt tr tre cij cgij clij clgij crj cgrj clrj clgrj \
-             cs csg cds cdsg
+             cs csg cds cdsg cu21 cu21_1
 
 check_PROGRAMS = $(INSN_TESTS) \
                 allexec \
@@ -33,3 +33,4 @@ allexec_CFLAGS   = $(AM_CFLAGS) @FLAG_W_NO_NONNULL@
 
 ex_clone_LDFLAGS = -lpthread
 tcxb_CFLAGS      = $(AM_CFLAGS) -std=gnu99
+cu21_1_CFLAGS    = $(AM_CFLAGS) -DM3=1
diff --git a/none/tests/s390x/cu21.c b/none/tests/s390x/cu21.c
new file mode 100644 (file)
index 0000000..b10e140
--- /dev/null
@@ -0,0 +1,269 @@
+#include <stdint.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include "opcodes.h"
+
+#ifndef M3
+#define M3 0
+#endif
+
+/* The abstracted result of an CU21 insn */
+typedef struct {
+   uint64_t addr1;  // target
+   uint64_t len1;
+   uint64_t addr2;  // source
+   uint64_t len2;
+   uint32_t cc;
+} cu21_t;
+
+/* Define various input buffers. */
+
+/* U+0000 to U+007f:  Result is 1 byte for each uint16_t */
+uint16_t pattern1[] = {
+   0x0000, 0x007f,    /* corner cases */
+   0x0047, 0x0056, 0x0045, 0x0021, 0x007b, 0x003a /* misc */
+};
+
+/* U+0080 to U+07ff:  Result is 2 bytes for each uint16_t */
+uint16_t pattern2[] = {
+   0x0080, 0x07ff,    /* corner cases */
+   0x07df, 0x008f, 0x0100, 0x017f, 0x052f, 0x0600, 0x06ff /* misc */
+};
+
+/* U+0800 to U+d7ff:  Result is 3 bytes for each uint16_t
+   U+dc00 to U+ffff:  Result is 3 bytes for each uint16_t */
+uint16_t pattern3[] = {
+   0x0800, 0xd7ff,    /* corner cases */
+   0xdc00, 0xffff,    /* corner cases */
+   0x083f, 0x1a21, 0x1b10, 0x2200, 0x225e, 0x22c9, 0xe001  /* misc */
+};
+
+/* U+d800 to U+dbff:  Result is 4 bytes for each uint16_t pair */
+uint16_t pattern4[] = {
+   0xd800, 0xdc00,    /* left  corner case */
+   0xdbff, 0xdfff,    /* right corner case */
+   0xdada, 0xdddd, 0xdeaf, 0xdcdc  /* misc */
+};
+
+/* Invalid low surrogate */
+uint16_t invalid[] = { 0xd801, 0x0098 };
+
+/* Mixed bytes */
+uint16_t mixed[] = {
+   0x0078 /* 1 byte */,
+   0x0200 /* 2 bytes */,
+   0xffff /* 3 bytes */,
+   0xd800, 0xdc01 /* 4 bytes */
+};
+
+/* This is the buffer for the converted bytes. */
+uint8_t buff[1000];  /* Large so we con'don't have to worry about it */
+
+void write_and_check(uint16_t *, unsigned, unsigned);
+
+
+static cu21_t
+do_cu21(uint8_t *dst, uint64_t dst_len, uint16_t *src, uint64_t src_len)
+{
+   int cc = 42;
+   cu21_t regs;
+
+   /* build up the register pairs */
+   register uint16_t *source     asm("4") = src;
+   register uint64_t  source_len asm("5") = src_len;
+   register uint8_t  *dest       asm("2") = dst;
+   register uint64_t  dest_len   asm("3") = dst_len;
+
+   asm volatile(
+                CU21(M3,2,4)
+                "ipm %2\n\t"
+                "srl %2,28\n\t"
+                : "+d"(dest), "+d"(source), "=d"(cc),
+                  "+d"(source_len), "+d"(dest_len)
+                :
+                : "memory", "cc");
+
+   /* Capture register contents at end of cu21 */
+   regs.addr1 = (uint64_t)dest;
+   regs.len1  = dest_len;
+   regs.addr2 = (uint64_t)source;
+   regs.len2  = source_len;
+   regs.cc = cc;
+   
+   return regs;
+}
+
+void
+run_test(uint8_t *dst, uint64_t dst_len, uint16_t *src, uint64_t src_len)
+{
+   int i;
+   cu21_t result;
+
+   result = do_cu21(dst, dst_len, src, src_len);
+
+   // Write out the converted bytes, if any
+   printf("UTF8: ");
+   if (dst_len - result.len1 == 0)
+      printf(" <none>");
+   else
+      for (i = 0; i < dst_len - result.len1; i++) {
+         printf(" %02x", dst[i]);
+      }
+   printf("\n");
+
+   printf("  cc = %d\n", result.cc);
+   if (dst != NULL)
+      printf("  dst address difference: %"PRId64, result.addr1 - (uint64_t)dst);
+   printf("  dst len: %"PRId64"\n", result.len1);
+
+   if (src != NULL)
+      printf("  src address difference: %"PRId64, result.addr2 - (uint64_t)src);
+   printf("  src len: %"PRId64"\n", result.len2);
+}
+
+int main()
+{
+   /* Length == 0, no memory should be read or written */
+   printf("\n------------- test1 ----------------\n");
+   run_test(NULL, 0, NULL, 0);
+
+   /* Test exhaustion of source length (source bytes are valid) */
+   printf("\n------------- test2.1 ----------------\n");
+
+   /* No character will be written to BUFF, i.e. loop in jitted code
+      is not iterated */
+   run_test(buff, sizeof buff, NULL,     1);
+   run_test(buff, sizeof buff, pattern1, 1);
+   run_test(buff, sizeof buff, pattern2, 1);
+   run_test(buff, sizeof buff, pattern3, 1);
+   run_test(buff, sizeof buff, pattern4, 1);
+   run_test(buff, sizeof buff, pattern4, 2);
+   run_test(buff, sizeof buff, pattern4, 3);
+
+   printf("\n------------- test2.2 ----------------\n");
+   /* At least one character will be written to BUFF, i.e. loop in jitted
+      code is iterated */
+   run_test(buff, sizeof buff, pattern1, 3);
+   run_test(buff, sizeof buff, pattern2, 5);
+   run_test(buff, sizeof buff, pattern3, 7);
+   run_test(buff, sizeof buff, pattern4, 9);
+   run_test(buff, sizeof buff, pattern4, 10);
+   run_test(buff, sizeof buff, pattern4, 11);
+
+   /* Test exhaustion of destination length (source bytes are valid) */
+   printf("\n------------- test3.1 ----------------\n");
+
+   /* No character will be written to BUFF, i.e. loop in jitted code
+      is not iterated */
+
+   /* Want to write a single byte */
+   run_test(NULL, 0, pattern1, sizeof pattern1);
+
+   /* Want to write two bytes */
+   run_test(NULL, 0, pattern2, sizeof pattern2);
+   run_test(NULL, 1, pattern2, sizeof pattern2);
+
+   /* Want to write three bytes */
+   run_test(NULL, 0, pattern3, sizeof pattern3);
+   run_test(NULL, 1, pattern3, sizeof pattern3);
+   run_test(NULL, 2, pattern3, sizeof pattern3);
+
+   /* Want to write four bytes */
+   run_test(NULL, 0, pattern4, sizeof pattern4);
+   run_test(NULL, 1, pattern4, sizeof pattern4);
+   run_test(NULL, 2, pattern4, sizeof pattern4);
+   run_test(NULL, 3, pattern4, sizeof pattern4);
+
+   printf("\n------------- test3.2 ----------------\n");
+   /* At least one character will be written to BUFF, i.e. loop in jitted
+      code is iterated */
+   run_test(buff, 3, pattern1, sizeof pattern1);
+
+   run_test(buff, 5, pattern2, sizeof pattern2);
+
+   run_test(buff, 7, pattern3, sizeof pattern3);
+   run_test(buff, 8, pattern3, sizeof pattern3);
+
+   run_test(buff,  9, pattern4, sizeof pattern4);
+   run_test(buff, 10, pattern4, sizeof pattern4);
+   run_test(buff, 11, pattern4, sizeof pattern4);
+
+   /* When both operands are exhausted, cc=0 takes precedence.
+      (test1 tests this for len == 0) */
+   printf("\n------------- test4 ----------------\n");
+   run_test(buff, 6, pattern1, 6);
+
+   /* Input has invalid low surrogate. */
+   printf("\n------------- test5 ----------------\n");
+   run_test(buff, sizeof buff, invalid, sizeof invalid);
+   run_test(buff, 0, invalid, sizeof invalid);
+
+   /* Convert all pattern buffers */
+   printf("\n------------- test6 ----------------\n");
+   run_test(buff, sizeof buff, pattern1, sizeof pattern1);
+   run_test(buff, sizeof buff, pattern2, sizeof pattern2);
+   run_test(buff, sizeof buff, pattern3, sizeof pattern3);
+   run_test(buff, sizeof buff, pattern4, sizeof pattern4);
+   run_test(buff, sizeof buff, mixed,    sizeof mixed);
+
+   /* Make sure we only write the exact number of bytes (and not more) */
+   uint16_t pat[2];
+
+   /* Write 1 byte */
+   printf("\n------------- test7.1 ----------------\n");
+   pat[0] = 0x10;
+   write_and_check(pat, 2, 1);
+
+   /* Write 2 bytes */
+   printf("\n------------- test7.2 ----------------\n");
+   pat[0] = 0x8f;
+   write_and_check(pat, 2, 2);
+
+   /* Write 3 bytes */
+   printf("\n------------- test7.3 ----------------\n");
+   pat[0] = 0x842;
+   write_and_check(pat, 2, 3);
+
+   /* Write 4 bytes */
+   printf("\n------------- test7.4 ----------------\n");
+   pat[0] = 0xd842;
+   pat[1] = 0xdc42;
+   write_and_check(pat, 2, 4);
+
+   return 0;
+}
+
+
+void
+write_and_check_aux(uint16_t *input, unsigned num_input_bytes,
+                    unsigned num_expected_output_bytes,
+                    unsigned fill_byte)
+{
+   int num_errors, i;
+
+   /* Fill output buffer with FILL_BYTE */
+   memset(buff, fill_byte, sizeof buff);
+
+   /* Execute cu21 */
+   run_test(buff, sizeof buff, input, num_input_bytes);
+
+   /* Make sure the rest of the buffer is unmodified.  */
+   num_errors = 0;
+   for (i = num_expected_output_bytes; i < sizeof buff; ++i)
+      if (buff[i] != fill_byte) ++num_errors;
+   if (num_errors)
+      fprintf(stderr, "*** wrote more than one byte\n");
+}
+
+void
+write_and_check(uint16_t *input, unsigned num_input_bytes,
+                unsigned num_expected_output_bytes)
+{
+   write_and_check_aux(input, num_input_bytes, num_expected_output_bytes, 0x0);
+
+   /* Run again with different fill pattern to make sure we did not write
+      an extra 0x0 byte */
+   write_and_check_aux(input, num_input_bytes, num_expected_output_bytes, 0xFF);
+}
diff --git a/none/tests/s390x/cu21.stderr.exp b/none/tests/s390x/cu21.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/s390x/cu21.stdout.exp b/none/tests/s390x/cu21.stdout.exp
new file mode 100644 (file)
index 0000000..1119f20
--- /dev/null
@@ -0,0 +1,212 @@
+
+------------- test1 ----------------
+UTF8:  <none>
+  cc = 0
+  dst len: 0
+  src len: 0
+
+------------- test2.1 ----------------
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 2
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 3
+
+------------- test2.2 ----------------
+UTF8:  00
+  cc = 0
+  dst address difference: 1  dst len: 999
+  src address difference: 2  src len: 1
+UTF8:  c2 80 df bf
+  cc = 0
+  dst address difference: 4  dst len: 996
+  src address difference: 4  src len: 1
+UTF8:  e0 a0 80 ed 9f bf ed b0 80
+  cc = 0
+  dst address difference: 9  dst len: 991
+  src address difference: 6  src len: 1
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 8  src len: 1
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 8  src len: 2
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 8  src len: 3
+
+------------- test3.1 ----------------
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 18
+UTF8:  <none>
+  cc = 1
+  dst len: 1
+  src address difference: 0  src len: 18
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 22
+UTF8:  <none>
+  cc = 1
+  dst len: 1
+  src address difference: 0  src len: 22
+UTF8:  <none>
+  cc = 1
+  dst len: 2
+  src address difference: 0  src len: 22
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 1
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 2
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 3
+  src address difference: 0  src len: 16
+
+------------- test3.2 ----------------
+UTF8:  00 7f 47
+  cc = 1
+  dst address difference: 3  dst len: 0
+  src address difference: 6  src len: 10
+UTF8:  c2 80 df bf
+  cc = 1
+  dst address difference: 4  dst len: 1
+  src address difference: 4  src len: 14
+UTF8:  e0 a0 80 ed 9f bf
+  cc = 1
+  dst address difference: 6  dst len: 1
+  src address difference: 4  src len: 18
+UTF8:  e0 a0 80 ed 9f bf
+  cc = 1
+  dst address difference: 6  dst len: 2
+  src address difference: 4  src len: 18
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 1
+  dst address difference: 8  dst len: 1
+  src address difference: 8  src len: 8
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 1
+  dst address difference: 8  dst len: 2
+  src address difference: 8  src len: 8
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 1
+  dst address difference: 8  dst len: 3
+  src address difference: 8  src len: 8
+
+------------- test4 ----------------
+UTF8:  00 7f 47
+  cc = 0
+  dst address difference: 3  dst len: 3
+  src address difference: 6  src len: 0
+
+------------- test5 ----------------
+UTF8:  f0 90 92 98
+  cc = 0
+  dst address difference: 4  dst len: 996
+  src address difference: 4  src len: 0
+UTF8:  <none>
+  cc = 1
+  dst address difference: 0  dst len: 0
+  src address difference: 0  src len: 4
+
+------------- test6 ----------------
+UTF8:  00 7f 47 56 45 21 7b 3a
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 16  src len: 0
+UTF8:  c2 80 df bf df 9f c2 8f c4 80 c5 bf d4 af d8 80 db bf
+  cc = 0
+  dst address difference: 18  dst len: 982
+  src address difference: 18  src len: 0
+UTF8:  e0 a0 80 ed 9f bf ed b0 80 ef bf bf e0 a0 bf e1 a8 a1 e1 ac 90 e2 88 80 e2 89 9e e2 8b 89 ee 80 81
+  cc = 0
+  dst address difference: 33  dst len: 967
+  src address difference: 22  src len: 0
+UTF8:  f0 90 80 80 f4 8f bf bf f3 86 a7 9d ed ba af ed b3 9c
+  cc = 0
+  dst address difference: 18  dst len: 982
+  src address difference: 16  src len: 0
+UTF8:  78 c8 80 ef bf bf f0 90 80 81
+  cc = 0
+  dst address difference: 10  dst len: 990
+  src address difference: 10  src len: 0
+
+------------- test7.1 ----------------
+UTF8:  10
+  cc = 0
+  dst address difference: 1  dst len: 999
+  src address difference: 2  src len: 0
+UTF8:  10
+  cc = 0
+  dst address difference: 1  dst len: 999
+  src address difference: 2  src len: 0
+
+------------- test7.2 ----------------
+UTF8:  c2 8f
+  cc = 0
+  dst address difference: 2  dst len: 998
+  src address difference: 2  src len: 0
+UTF8:  c2 8f
+  cc = 0
+  dst address difference: 2  dst len: 998
+  src address difference: 2  src len: 0
+
+------------- test7.3 ----------------
+UTF8:  e0 a1 82
+  cc = 0
+  dst address difference: 3  dst len: 997
+  src address difference: 2  src len: 0
+UTF8:  e0 a1 82
+  cc = 0
+  dst address difference: 3  dst len: 997
+  src address difference: 2  src len: 0
+
+------------- test7.4 ----------------
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 2
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 2
diff --git a/none/tests/s390x/cu21.vgtest b/none/tests/s390x/cu21.vgtest
new file mode 100644 (file)
index 0000000..39bb6c6
--- /dev/null
@@ -0,0 +1 @@
+prog: cu21
diff --git a/none/tests/s390x/cu21_1.c b/none/tests/s390x/cu21_1.c
new file mode 120000 (symlink)
index 0000000..d919a51
--- /dev/null
@@ -0,0 +1 @@
+cu21.c
\ No newline at end of file
diff --git a/none/tests/s390x/cu21_1.stderr.exp b/none/tests/s390x/cu21_1.stderr.exp
new file mode 100644 (file)
index 0000000..139597f
--- /dev/null
@@ -0,0 +1,2 @@
+
+
diff --git a/none/tests/s390x/cu21_1.stdout.exp b/none/tests/s390x/cu21_1.stdout.exp
new file mode 100644 (file)
index 0000000..95a829f
--- /dev/null
@@ -0,0 +1,212 @@
+
+------------- test1 ----------------
+UTF8:  <none>
+  cc = 0
+  dst len: 0
+  src len: 0
+
+------------- test2.1 ----------------
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 1
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 2
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 3
+
+------------- test2.2 ----------------
+UTF8:  00
+  cc = 0
+  dst address difference: 1  dst len: 999
+  src address difference: 2  src len: 1
+UTF8:  c2 80 df bf
+  cc = 0
+  dst address difference: 4  dst len: 996
+  src address difference: 4  src len: 1
+UTF8:  e0 a0 80 ed 9f bf ed b0 80
+  cc = 0
+  dst address difference: 9  dst len: 991
+  src address difference: 6  src len: 1
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 8  src len: 1
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 8  src len: 2
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 8  src len: 3
+
+------------- test3.1 ----------------
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 18
+UTF8:  <none>
+  cc = 1
+  dst len: 1
+  src address difference: 0  src len: 18
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 22
+UTF8:  <none>
+  cc = 1
+  dst len: 1
+  src address difference: 0  src len: 22
+UTF8:  <none>
+  cc = 1
+  dst len: 2
+  src address difference: 0  src len: 22
+UTF8:  <none>
+  cc = 1
+  dst len: 0
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 1
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 2
+  src address difference: 0  src len: 16
+UTF8:  <none>
+  cc = 1
+  dst len: 3
+  src address difference: 0  src len: 16
+
+------------- test3.2 ----------------
+UTF8:  00 7f 47
+  cc = 1
+  dst address difference: 3  dst len: 0
+  src address difference: 6  src len: 10
+UTF8:  c2 80 df bf
+  cc = 1
+  dst address difference: 4  dst len: 1
+  src address difference: 4  src len: 14
+UTF8:  e0 a0 80 ed 9f bf
+  cc = 1
+  dst address difference: 6  dst len: 1
+  src address difference: 4  src len: 18
+UTF8:  e0 a0 80 ed 9f bf
+  cc = 1
+  dst address difference: 6  dst len: 2
+  src address difference: 4  src len: 18
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 1
+  dst address difference: 8  dst len: 1
+  src address difference: 8  src len: 8
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 1
+  dst address difference: 8  dst len: 2
+  src address difference: 8  src len: 8
+UTF8:  f0 90 80 80 f4 8f bf bf
+  cc = 1
+  dst address difference: 8  dst len: 3
+  src address difference: 8  src len: 8
+
+------------- test4 ----------------
+UTF8:  00 7f 47
+  cc = 0
+  dst address difference: 3  dst len: 3
+  src address difference: 6  src len: 0
+
+------------- test5 ----------------
+UTF8:  <none>
+  cc = 2
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 4
+UTF8:  <none>
+  cc = 2
+  dst address difference: 0  dst len: 0
+  src address difference: 0  src len: 4
+
+------------- test6 ----------------
+UTF8:  00 7f 47 56 45 21 7b 3a
+  cc = 0
+  dst address difference: 8  dst len: 992
+  src address difference: 16  src len: 0
+UTF8:  c2 80 df bf df 9f c2 8f c4 80 c5 bf d4 af d8 80 db bf
+  cc = 0
+  dst address difference: 18  dst len: 982
+  src address difference: 18  src len: 0
+UTF8:  e0 a0 80 ed 9f bf ed b0 80 ef bf bf e0 a0 bf e1 a8 a1 e1 ac 90 e2 88 80 e2 89 9e e2 8b 89 ee 80 81
+  cc = 0
+  dst address difference: 33  dst len: 967
+  src address difference: 22  src len: 0
+UTF8:  f0 90 80 80 f4 8f bf bf f3 86 a7 9d ed ba af ed b3 9c
+  cc = 0
+  dst address difference: 18  dst len: 982
+  src address difference: 16  src len: 0
+UTF8:  78 c8 80 ef bf bf f0 90 80 81
+  cc = 0
+  dst address difference: 10  dst len: 990
+  src address difference: 10  src len: 0
+
+------------- test7.1 ----------------
+UTF8:  10
+  cc = 0
+  dst address difference: 1  dst len: 999
+  src address difference: 2  src len: 0
+UTF8:  10
+  cc = 0
+  dst address difference: 1  dst len: 999
+  src address difference: 2  src len: 0
+
+------------- test7.2 ----------------
+UTF8:  c2 8f
+  cc = 0
+  dst address difference: 2  dst len: 998
+  src address difference: 2  src len: 0
+UTF8:  c2 8f
+  cc = 0
+  dst address difference: 2  dst len: 998
+  src address difference: 2  src len: 0
+
+------------- test7.3 ----------------
+UTF8:  e0 a1 82
+  cc = 0
+  dst address difference: 3  dst len: 997
+  src address difference: 2  src len: 0
+UTF8:  e0 a1 82
+  cc = 0
+  dst address difference: 3  dst len: 997
+  src address difference: 2  src len: 0
+
+------------- test7.4 ----------------
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 2
+UTF8:  <none>
+  cc = 0
+  dst address difference: 0  dst len: 1000
+  src address difference: 0  src len: 2
diff --git a/none/tests/s390x/cu21_1.vgtest b/none/tests/s390x/cu21_1.vgtest
new file mode 100644 (file)
index 0000000..153c7a4
--- /dev/null
@@ -0,0 +1,2 @@
+prereq: ../../../tests/s390x_features s390x-etf3
+prog: cu21_1