Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Generate object for disasm_options_test from asm
Browse files Browse the repository at this point in the history
The test should not depend on changes in codegen, as it is only testing
the disassembler.

Change-Id: Id89a45975bcb8fe41af8369095ed2842bfc71f1d
  • Loading branch information
slinder1 committed Jun 24, 2019
1 parent 495a96d commit ea42885
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/comgr/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ endmacro()

add_test_input_binary(reloc1 reloc1.cl reloc1.o -c -mno-code-object-v3)
add_test_input_binary(reloc2 reloc2.cl reloc2.o -c -mno-code-object-v3)
add_test_input_binary(reloc-asm reloc-asm.s reloc-asm.o -c -mno-code-object-v3)
add_test_input_binary(shared shared.cl shared.so -mno-code-object-v3)
add_test_input_binary(shared-v3 shared.cl shared-v3.so -mcode-object-v3)
configure_file("source1.cl" "source1.cl" COPYONLY)
Expand Down
16 changes: 8 additions & 8 deletions lib/comgr/test/disasm_options_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ const char *expectedOut = "\n"
"Disassembly of section .text:\n"
"foo:\n"
"\ts_load_dwordx2 s[0:1], s[4:5], 0x0 "
" // 000000000100: C0060002 00000000 \n"
" // 000000000000: C0060002 00000000 \n"
"\tv_mov_b32_e32 v2, 42 "
" // 000000000108: 7E0402AA \n"
" // 000000000008: 7E0402AA \n"
"\ts_waitcnt lgkmcnt(0) "
" // 00000000010C: BF8C007F \n"
" // 00000000000C: BF8C007F \n"
"\tv_mov_b32_e32 v0, s0 "
" // 000000000110: 7E000200 \n"
" // 000000000010: 7E000200 \n"
"\tv_mov_b32_e32 v1, s1 "
" // 000000000114: 7E020201 \n"
" // 000000000014: 7E020201 \n"
"\tflat_store_dword v[0:1], v2 "
" // 000000000118: DC700000 00000200 \n"
" // 000000000018: DC700000 00000200 \n"
"\ts_endpgm "
" // 000000000120: BF810000 \n";
" // 000000000020: BF810000 \n";

// TODO: Fix Options
const char *expectedLog =
Expand Down Expand Up @@ -105,7 +105,7 @@ int main(int argc, char *argv[]) {
size_t disAsmOptionsCount = sizeof(disAsmOptions) / sizeof(disAsmOptions[0]);

// Read input file
size = setBuf(TEST_OBJ_DIR "/reloc1.o", &buf);
size = setBuf(TEST_OBJ_DIR "/reloc-asm.o", &buf);

status = amd_comgr_create_data_set(&dataSetIn);
checkError(status, "amd_cogmr_create_data_set");
Expand Down
19 changes: 19 additions & 0 deletions lib/comgr/test/reloc-asm.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.text
.file "reloc-asm.c"
.globl foo
.p2align 4, 0x90
.type foo,@function
foo:
s_load_dwordx2 s[0:1], s[4:5], 0x0 // 000000000000: C0060002 00000000
v_mov_b32_e32 v2, 42 // 000000000008: 7E0402AA
s_waitcnt lgkmcnt(0) // 00000000000C: BF8C007F
v_mov_b32_e32 v0, s0 // 000000000010: 7E000200
v_mov_b32_e32 v1, s1 // 000000000014: 7E020201
flat_store_dword v[0:1], v2 // 000000000018: DC700000 00000200
s_endpgm
.Lfunc_end0:
.size foo, .Lfunc_end0-foo

.ident "clang"
.section ".note.GNU-stack","",@progbits
.addrsig

0 comments on commit ea42885

Please sign in to comment.