Path: blob/21.2-virgl/src/amd/compiler/tests/test_tests.cpp
7099 views
/*1* Copyright © 2020 Valve Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*22*/23#include "helpers.h"24#include <stdio.h>2526using namespace aco;2728BEGIN_TEST_TODO(todo)29//!test!30fprintf(output, "woops!\n");31END_TEST3233BEGIN_TEST_FAIL(expect_fail)34//!test!35fprintf(output, "woops!\n");36END_TEST3738BEGIN_TEST(simple.1)39//! s_buffer_load_dwordx2 @s64(a)40fprintf(output, "s_buffer_load_dwordx2 s[6:7]\n");41//! s_add_u32 s#b0, s#a, 142//! s_addc_u32 s#b1, s#a1, 043//; success = int(b0) == 844fprintf(output, "s_add_u32 s8, s6, 1\n");45fprintf(output, "s_addc_u32 s9, s7, 0\n");46//! s_buffer_store_dwordx2 @s64(b)47fprintf(output, "s_buffer_store_dwordx2 s[8:9]\n");48END_TEST4950BEGIN_TEST(simple.2)51//~gfx[67]! test gfx6752//~gfx8! test gfx853//~gfx9! test gfx954//! test all55for (int cls = GFX6; cls <= GFX7; cls++) {56if (!set_variant((enum chip_class)cls))57continue;58fprintf(output, "test gfx67\n");59fprintf(output, "test all\n");60}6162if (set_variant("gfx8")) {63fprintf(output, "test gfx8\n");64fprintf(output, "test all\n");65}6667if (set_variant("gfx9")) {68fprintf(output, "test gfx9\n");69fprintf(output, "test all\n");70}71END_TEST7273BEGIN_TEST(simple.3)74//; funcs['test'] = lambda a: a75//! @test(s_buffer_load_dwordx2) @s64(a)76fprintf(output, "s_buffer_load_dwordx2 s[6:7]\n");77END_TEST787980