From 3410cb41f36e6ab803486af76003dcdda10fc3fe Mon Sep 17 00:00:00 2001 From: Andreas Beckmann Date: Thu, 2 Dec 2021 23:49:57 +0100 Subject: [PATCH] [PATCH 59/90] move vector type printf tests to a separate test Gbp-Pq: Name 0059-move-vector-type-printf-tests-to-a-separate-test.patch --- tests/kernel/CMakeLists.txt | 9 +++++++- tests/kernel/test_printf.cl | 22 ------------------- tests/kernel/test_printf_expout.txt | 20 ----------------- tests/kernel/test_printf_vectors.cl | 24 +++++++++++++++++++++ tests/kernel/test_printf_vectors_expout.txt | 22 +++++++++++++++++++ 5 files changed, 54 insertions(+), 43 deletions(-) create mode 100644 tests/kernel/test_printf_vectors.cl create mode 100644 tests/kernel/test_printf_vectors_expout.txt diff --git a/tests/kernel/CMakeLists.txt b/tests/kernel/CMakeLists.txt index 50fc69c..93c2a57 100644 --- a/tests/kernel/CMakeLists.txt +++ b/tests/kernel/CMakeLists.txt @@ -222,6 +222,10 @@ add_test_pocl(NAME "kernel/test_printf" EXPECTED_OUTPUT "test_printf_expout.txt" COMMAND "kernel" "test_printf") +add_test_pocl(NAME "kernel/test_printf_vectors" + EXPECTED_OUTPUT "test_printf_vectors_expout.txt" + COMMAND "kernel" "test_printf_vectors") + add_test_pocl(NAME "kernel/test_sizeof_uint" EXPECTED_OUTPUT "test_sizeof_expout.txt" COMMAND "kernel" "test_sizeof") @@ -237,7 +241,9 @@ set_tests_properties("kernel/test_shuffle_char" "kernel/test_shuffle_int" "kernel/test_shuffle_uint" "kernel/test_shuffle_long" "kernel/test_shuffle_ulong" "kernel/test_shuffle_float" ${EXTRA_TESTS} - "kernel/test_printf" "kernel/test_sizeof_uint" + "kernel/test_printf" + "kernel/test_printf_vectors" + "kernel/test_sizeof_uint" PROPERTIES COST 77 @@ -301,6 +307,7 @@ endif() set_property(TEST "kernel/test_local_struct_array" "kernel/test_printf" + "kernel/test_printf_vectors" "kernel/test_shuffle_char" "kernel/test_shuffle_short" "kernel/test_shuffle_ushort" diff --git a/tests/kernel/test_printf.cl b/tests/kernel/test_printf.cl index 0799977..a22ed53 100644 --- a/tests/kernel/test_printf.cl +++ b/tests/kernel/test_printf.cl @@ -159,29 +159,7 @@ kernel void test_printf() printf ("%4.6f\n", M_PI); printf ("%4.7f\n", M_PI); - printf ("\nVECTORS\n\n"); - - printf("%v4hld\n", (int4)9); - printf("%v4hlf\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+12)); - printf("%10.7v4hlf\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f)); - printf("%v4hlg\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+33)); - printf("%v4hlF\n", (float4)(8.0f, INFINITY, -INFINITY, NAN)); - - printf("%v4hla\n", (float4)(10.0f, 3.88E-43f, 4.0E23f, 0.0f)); - printf("%v4hla\n", (float4)(90.0f, 9.0f, 0.9f, 0.09f)); - printf("%v4hla\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f)); - - printf("%#v2hhx\n",(char2)(0xFA,0xFB)); - printf("%#v2hx\n",(short2)(0x1234,0x8765)); - printf("%#v2hlx\n",(int2)(0x12345678,0x87654321)); - printf("|%c|%4c|%-4c|\n", 'a', 'b', 'c'); printf("|%s|%4s|%-4s|%4s|%.4s|\n", "aa", "bb", "cc", "dddddddddd", "eeeeee"); printf("|%p|%12p|%-12p|\n", (void*)0x2349aacc, (void*)0xdeaddeed, (void*)0x92820384); - - printf ("\nPARAMETER PASSING\n\n"); - - printf("%c %#v2hhx %#v2hhx %c\n", '*', (char2)(0xFA, 0xFB), (char2)(0xFC, 0xFD), '.'); - printf("%c %#v2hx %#v2hx %c\n", '*', (short2)(0x1234, 0x8765), (short2)(0xBEEF, 0xF00D), '.'); - printf("%c %#v2hlx %#v2hlx %c\n", '*', (int2)(0x12345678, 0x87654321), (int2)(0x2468ACE0, 0xFDB97531), '.'); } diff --git a/tests/kernel/test_printf_expout.txt b/tests/kernel/test_printf_expout.txt index 81937eb..258ba48 100644 --- a/tests/kernel/test_printf_expout.txt +++ b/tests/kernel/test_printf_expout.txt @@ -134,27 +134,7 @@ quickfoxjump 3.14 3.141593 3.1415927 - -VECTORS - -9,9,9,9 -90.000000,9.000000,0.900000,1986545975296.000000 -4096.0000000, 1.0000000, 0.1250000, 0.0078125 -90,9,0.9,1.98655e+33 -8.000000,INF,-INF,NAN -0x1.4p+3,0x1.15p-141,0x1.52d02cp+78,0x0p+0 -0x1.68p+6,0x1.2p+3,0x1.ccccccp-1,0x1.70a3d8p-4 -0x1p+12,0x1p+0,0x1p-3,0x1p-7 -0xfa,0xfb -0x1234,0x8765 -0x12345678,0x87654321 |a| b|c | |aa| bb|cc |dddddddddd|eeee| |0x2349aacc| 0xdeaddeed|0x92820384 | - -PARAMETER PASSING - -* 0xfa,0xfb 0xfc,0xfd . -* 0x1234,0x8765 0xbeef,0xf00d . -* 0x12345678,0x87654321 0x2468ace0,0xfdb97531 . OK diff --git a/tests/kernel/test_printf_vectors.cl b/tests/kernel/test_printf_vectors.cl new file mode 100644 index 0000000..577491c --- /dev/null +++ b/tests/kernel/test_printf_vectors.cl @@ -0,0 +1,24 @@ +kernel void test_printf_vectors() +{ + printf ("\nVECTORS\n\n"); + + printf("%v4hld\n", (int4)9); + printf("%v4hlf\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+12)); + printf("%10.7v4hlf\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f)); + printf("%v4hlg\n", (float4)(90.0f, 9.0f, 0.9f, 1.986546E+33)); + printf("%v4hlF\n", (float4)(8.0f, INFINITY, -INFINITY, NAN)); + + printf("%v4hla\n", (float4)(10.0f, 3.88E-43f, 4.0E23f, 0.0f)); + printf("%v4hla\n", (float4)(90.0f, 9.0f, 0.9f, 0.09f)); + printf("%v4hla\n", (float4)(4096.0f, 1.0f, 0.125f, 0.0078125f)); + + printf("%#v2hhx\n",(char2)(0xFA,0xFB)); + printf("%#v2hx\n",(short2)(0x1234,0x8765)); + printf("%#v2hlx\n",(int2)(0x12345678,0x87654321)); + + printf ("\nPARAMETER PASSING\n\n"); + + printf("%c %#v2hhx %#v2hhx %c\n", '*', (char2)(0xFA, 0xFB), (char2)(0xFC, 0xFD), '.'); + printf("%c %#v2hx %#v2hx %c\n", '*', (short2)(0x1234, 0x8765), (short2)(0xBEEF, 0xF00D), '.'); + printf("%c %#v2hlx %#v2hlx %c\n", '*', (int2)(0x12345678, 0x87654321), (int2)(0x2468ACE0, 0xFDB97531), '.'); +} diff --git a/tests/kernel/test_printf_vectors_expout.txt b/tests/kernel/test_printf_vectors_expout.txt new file mode 100644 index 0000000..0a0f2b9 --- /dev/null +++ b/tests/kernel/test_printf_vectors_expout.txt @@ -0,0 +1,22 @@ +Running test test_printf_vectors... + +VECTORS + +9,9,9,9 +90.000000,9.000000,0.900000,1986545975296.000000 +4096.0000000, 1.0000000, 0.1250000, 0.0078125 +90,9,0.9,1.98655e+33 +8.000000,INF,-INF,NAN +0x1.4p+3,0x1.15p-141,0x1.52d02cp+78,0x0p+0 +0x1.68p+6,0x1.2p+3,0x1.ccccccp-1,0x1.70a3d8p-4 +0x1p+12,0x1p+0,0x1p-3,0x1p-7 +0xfa,0xfb +0x1234,0x8765 +0x12345678,0x87654321 + +PARAMETER PASSING + +* 0xfa,0xfb 0xfc,0xfd . +* 0x1234,0x8765 0xbeef,0xf00d . +* 0x12345678,0x87654321 0x2468ace0,0xfdb97531 . +OK -- 2.30.2