diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2025-09-04 17:56:01 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-09-04 17:56:01 -0700 |
| commit | 61a38830b94c28b3fcead3e22161c3dd621d25c9 (patch) | |
| tree | 8ae9664d2feae319bb7da12ddd7cc7e06751f1ae /tools/asm-processor/tests | |
| parent | a4d5910cdb9bed05fa5aea4476a3cf4ef178be06 (diff) | |
* git subrepo pull tools/asm-processor
subrepo:
subdir: "tools/asm-processor"
merged: "5c3984fc"
upstream:
origin: "git@github.com:simonlindholm/asm-processor.git"
branch: "main"
commit: "5c3984fc"
git-subrepo:
version: "0.4.9"
origin: "git@github.com:ingydotnet/git-subrepo.git"
commit: "ea10886"
* Fix things needed for new spimdisasm release
Diffstat (limited to 'tools/asm-processor/tests')
30 files changed, 179 insertions, 25 deletions
diff --git a/tools/asm-processor/tests/custom-prelude.c b/tools/asm-processor/tests/custom-prelude.c new file mode 100644 index 0000000..1b057d5 --- /dev/null +++ b/tools/asm-processor/tests/custom-prelude.c @@ -0,0 +1,17 @@ +// COMPILE-FLAGS: -O2 +// ASMP-FLAGS: --asm-prelude tests/custom-prelude.s + +GLOBAL_ASM( +glabel foo +nop +nop +nop +nop +nop +nop +nop +nop +nop +nop +endlabel foo +) diff --git a/tools/asm-processor/tests/custom-prelude.objdump b/tools/asm-processor/tests/custom-prelude.objdump new file mode 100644 index 0000000..37af655 --- /dev/null +++ b/tools/asm-processor/tests/custom-prelude.objdump @@ -0,0 +1,21 @@ + +tests/custom-prelude.o: file format elf32-tradbigmips + +SYMBOL TABLE: +00000000 l d .text 00000030 .text +00000000 g F .text 00000028 foo +00000028 g .text 00000000 myendlabel + + +Contents of section .text: + 0000 00000000 00000000 00000000 00000000 ................ + 0010 00000000 00000000 00000000 00000000 ................ + 0020 00000000 00000000 00000000 00000000 ................ +Contents of section .options: + 0000 01200000 00000000 80000000 00000000 . .............. + 0010 00000000 00000000 00000000 00007ff0 ................ + 0020 07100000 00000000 00000000 00000000 ................ + 0030 08100000 00000000 00000000 00000000 ................ +Contents of section .reginfo: + 0000 80000000 00000000 00000000 00000000 ................ + 0010 00000000 00007ff0 ........ diff --git a/tools/asm-processor/tests/custom-prelude.s b/tools/asm-processor/tests/custom-prelude.s new file mode 100644 index 0000000..75f955a --- /dev/null +++ b/tools/asm-processor/tests/custom-prelude.s @@ -0,0 +1,14 @@ +.set noat +.set noreorder +.set gp=64 + +.macro glabel label + .global \label + \label: +.endm + +.macro endlabel label + .global myendlabel + myendlabel: +.endm + diff --git a/tools/asm-processor/tests/euc_jp_wavedash.c b/tools/asm-processor/tests/euc_jp_wavedash.c new file mode 100644 index 0000000..d187d7d --- /dev/null +++ b/tools/asm-processor/tests/euc_jp_wavedash.c @@ -0,0 +1,3 @@ +// ASMP-FLAGS: --force --input-enc=utf-8 --output-enc=EUC-JP + +char *chars = "〜!?@#";
\ No newline at end of file diff --git a/tools/asm-processor/tests/euc_jp_wavedash.objdump b/tools/asm-processor/tests/euc_jp_wavedash.objdump new file mode 100644 index 0000000..5820e73 --- /dev/null +++ b/tools/asm-processor/tests/euc_jp_wavedash.objdump @@ -0,0 +1,26 @@ + +tests/euc_jp_wavedash.o: file format elf32-tradbigmips + +SYMBOL TABLE: +00000000 l d .rodata 00000010 .rodata +00000000 l d .data 00000010 .data +00000000 g O .data 00000004 chars + + +RELOCATION RECORDS FOR [.data]: +OFFSET TYPE VALUE +00000000 R_MIPS_32 .rodata + + +Contents of section .rodata: + 0000 a1c1a1aa a1a9a1f7 a1f40000 00000000 ................ +Contents of section .data: + 0000 00000000 00000000 00000000 00000000 ................ +Contents of section .options: + 0000 01200000 00000000 00000000 00000000 . .............. + 0010 00000000 00000000 00000000 00007ff0 ................ + 0020 07100000 00000000 00000000 00000000 ................ + 0030 08100000 00000000 00000000 00000000 ................ +Contents of section .reginfo: + 0000 00000000 00000000 00000000 00000000 ................ + 0010 00000000 00007ff0 ........ diff --git a/tools/asm-processor/tests/force.c b/tools/asm-processor/tests/force.c index 03b630c..32d8706 100644 --- a/tools/asm-processor/tests/force.c +++ b/tools/asm-processor/tests/force.c @@ -1,5 +1,5 @@ // COMPILE-FLAGS: -O2 -// ASMP-FLAGS: --convert-statics=global-with-filename --force +// ASMP-FLAGS: --convert-statics global-with-filename --force static int xtext(int a, int b, int c); const int rodata1[] = {1}; static const int rodata2[] = {2}; diff --git a/tools/asm-processor/tests/force.objdump b/tools/asm-processor/tests/force.objdump index 7ef7024..46941d3 100644 --- a/tools/asm-processor/tests/force.objdump +++ b/tools/asm-processor/tests/force.objdump @@ -17,7 +17,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000001c R_MIPS_HI16 .bss 00000034 R_MIPS_LO16 .bss 00000020 R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/include_file.asmproc.d b/tools/asm-processor/tests/include_file.asmproc.d new file mode 100644 index 0000000..80d2d66 --- /dev/null +++ b/tools/asm-processor/tests/include_file.asmproc.d @@ -0,0 +1,12 @@ +tests/include_file.o: tests/include_file_1.s \ + tests/include_file_2.s \ + tests/include_file_3.s \ + tests//include_file_4.s + +tests/include_file_1.s: + +tests/include_file_2.s: + +tests/include_file_3.s: + +tests//include_file_4.s: diff --git a/tools/asm-processor/tests/include_file.c b/tools/asm-processor/tests/include_file.c new file mode 100644 index 0000000..97eb45d --- /dev/null +++ b/tools/asm-processor/tests/include_file.c @@ -0,0 +1,8 @@ +GLOBAL_ASM("tests/include_file_1.s") +#pragma GLOBAL_ASM("tests/include_file_2.s") +INCLUDE_ASM("tests", include_file_3); +INCLUDE_RODATA("tests/", include_file_4); +#if 0 +GLOBAL_ASM("tests/nonexisting.s"); +INCLUDE_ASM("tests", nonexisting); +#endif diff --git a/tools/asm-processor/tests/include_file.objdump b/tools/asm-processor/tests/include_file.objdump new file mode 100644 index 0000000..c2b172b --- /dev/null +++ b/tools/asm-processor/tests/include_file.objdump @@ -0,0 +1,27 @@ + +tests/include_file.o: file format elf32-tradbigmips + +SYMBOL TABLE: +00000000 l d .text 00000050 .text +00000000 l d .rodata 00000010 .rodata +00000000 g F .text 00000018 file_1 +00000018 g F .text 00000018 file_2 +00000030 g F .text 00000018 file_3 + + +Contents of section .text: + 0000 24050000 24050001 24050002 24050003 $...$...$...$... + 0010 24050004 24050005 24060000 24060001 $...$...$...$... + 0020 24060002 24060003 24060004 24060005 $...$...$...$... + 0030 24070000 24070001 24070002 24070003 $...$...$...$... + 0040 24070004 24070005 00000000 00000000 $...$........... +Contents of section .rodata: + 0000 00000005 00000006 00000007 00000008 ................ +Contents of section .options: + 0000 01200000 00000000 80000000 00000000 . .............. + 0010 00000000 00000000 00000000 00007ff0 ................ + 0020 07100000 00000000 00000000 00000000 ................ + 0030 08100000 00000000 00000000 00000000 ................ +Contents of section .reginfo: + 0000 800000e0 00000000 00000000 00000000 ................ + 0010 00000000 00007ff0 ........ diff --git a/tools/asm-processor/tests/include_file_1.s b/tools/asm-processor/tests/include_file_1.s new file mode 100644 index 0000000..24a67f9 --- /dev/null +++ b/tools/asm-processor/tests/include_file_1.s @@ -0,0 +1,7 @@ +glabel file_1 +li $a1, 0 +li $a1, 1 +li $a1, 2 +li $a1, 3 +li $a1, 4 +li $a1, 5 diff --git a/tools/asm-processor/tests/include_file_2.s b/tools/asm-processor/tests/include_file_2.s new file mode 100644 index 0000000..4260197 --- /dev/null +++ b/tools/asm-processor/tests/include_file_2.s @@ -0,0 +1,7 @@ +glabel file_2 +li $a2, 0 +li $a2, 1 +li $a2, 2 +li $a2, 3 +li $a2, 4 +li $a2, 5 diff --git a/tools/asm-processor/tests/include_file_3.s b/tools/asm-processor/tests/include_file_3.s new file mode 100644 index 0000000..d0123af --- /dev/null +++ b/tools/asm-processor/tests/include_file_3.s @@ -0,0 +1,7 @@ +glabel file_3 +li $a3, 0 +li $a3, 1 +li $a3, 2 +li $a3, 3 +li $a3, 4 +li $a3, 5 diff --git a/tools/asm-processor/tests/include_file_4.s b/tools/asm-processor/tests/include_file_4.s new file mode 100644 index 0000000..94cb710 --- /dev/null +++ b/tools/asm-processor/tests/include_file_4.s @@ -0,0 +1 @@ +.word 5, 6, 7, 8 diff --git a/tools/asm-processor/tests/label-sameline.objdump b/tools/asm-processor/tests/label-sameline.objdump index 1f1aacf..e69f69c 100644 --- a/tools/asm-processor/tests/label-sameline.objdump +++ b/tools/asm-processor/tests/label-sameline.objdump @@ -8,7 +8,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.rodata]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000004 R_MIPS_32 00000008 R_MIPS_32 blah diff --git a/tools/asm-processor/tests/late_rodata_align.objdump b/tools/asm-processor/tests/late_rodata_align.objdump index 87c05e8..0f7f4c0 100644 --- a/tools/asm-processor/tests/late_rodata_align.objdump +++ b/tools/asm-processor/tests/late_rodata_align.objdump @@ -12,7 +12,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000040 R_MIPS_HI16 .rodata 00000048 R_MIPS_LO16 .rodata 00000090 R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/late_rodata_doubles.objdump b/tools/asm-processor/tests/late_rodata_doubles.objdump index 84d7e67..3545768 100644 --- a/tools/asm-processor/tests/late_rodata_doubles.objdump +++ b/tools/asm-processor/tests/late_rodata_doubles.objdump @@ -13,7 +13,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000040 R_MIPS_HI16 .rodata 00000048 R_MIPS_LO16 .rodata 0000009c R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/late_rodata_doubles_mips1.objdump b/tools/asm-processor/tests/late_rodata_doubles_mips1.objdump index 8fac85f..667ee7d 100644 --- a/tools/asm-processor/tests/late_rodata_doubles_mips1.objdump +++ b/tools/asm-processor/tests/late_rodata_doubles_mips1.objdump @@ -13,7 +13,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000040 R_MIPS_HI16 .rodata 00000044 R_MIPS_LO16 .rodata 00000090 R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/late_rodata_jtbl.objdump b/tools/asm-processor/tests/late_rodata_jtbl.objdump index 44bb6e8..53f664b 100644 --- a/tools/asm-processor/tests/late_rodata_jtbl.objdump +++ b/tools/asm-processor/tests/late_rodata_jtbl.objdump @@ -16,7 +16,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000005c R_MIPS_HI16 .rodata 00000064 R_MIPS_LO16 .rodata 0000018c R_MIPS_HI16 .rodata @@ -26,7 +26,7 @@ OFFSET TYPE VALUE RELOCATION RECORDS FOR [.rodata]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000008c R_MIPS_32 00000090 R_MIPS_32 00000094 R_MIPS_32 diff --git a/tools/asm-processor/tests/late_rodata_jtbl_mips1.objdump b/tools/asm-processor/tests/late_rodata_jtbl_mips1.objdump index d37c8bb..a781a92 100644 --- a/tools/asm-processor/tests/late_rodata_jtbl_mips1.objdump +++ b/tools/asm-processor/tests/late_rodata_jtbl_mips1.objdump @@ -16,7 +16,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000005c R_MIPS_HI16 .rodata 00000060 R_MIPS_LO16 .rodata 00000190 R_MIPS_HI16 .rodata @@ -26,7 +26,7 @@ OFFSET TYPE VALUE RELOCATION RECORDS FOR [.rodata]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000008c R_MIPS_32 00000090 R_MIPS_32 00000094 R_MIPS_32 diff --git a/tools/asm-processor/tests/late_rodata_misaligned_doubles.objdump b/tools/asm-processor/tests/late_rodata_misaligned_doubles.objdump index cdba84d..46cdc0c 100644 --- a/tools/asm-processor/tests/late_rodata_misaligned_doubles.objdump +++ b/tools/asm-processor/tests/late_rodata_misaligned_doubles.objdump @@ -13,7 +13,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000040 R_MIPS_HI16 .rodata 00000048 R_MIPS_LO16 .rodata 0000009c R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/o0.objdump b/tools/asm-processor/tests/o0.objdump index f94ec7a..98a27dc 100644 --- a/tools/asm-processor/tests/o0.objdump +++ b/tools/asm-processor/tests/o0.objdump @@ -13,7 +13,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000030 R_MIPS_HI16 .rodata 00000034 R_MIPS_LO16 .rodata 0000006c R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/o2.objdump b/tools/asm-processor/tests/o2.objdump index 61e3fb0..07b3895 100644 --- a/tools/asm-processor/tests/o2.objdump +++ b/tools/asm-processor/tests/o2.objdump @@ -13,7 +13,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000001c R_MIPS_HI16 .rodata 00000024 R_MIPS_LO16 .rodata 0000003c R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/pascal.objdump b/tools/asm-processor/tests/pascal.objdump index cb3740f..de2db82 100644 --- a/tools/asm-processor/tests/pascal.objdump +++ b/tools/asm-processor/tests/pascal.objdump @@ -9,8 +9,8 @@ SYMBOL TABLE: 00000000 l O .bss 00000000 $dat 00000000 g F .text 0000000c foo 000000d0 g F .text 0000000c bar -0000000c g F .text 00000004 test -00000048 g F .text 00000004 test2 +0000000c g F .text 0000003c test +00000048 g F .text 00000044 test2 0000008c g F .text 00000044 test3 00000000 *UND* 00000000 get 00000000 *UND* 00000000 put diff --git a/tools/asm-processor/tests/static-global.c b/tools/asm-processor/tests/static-global.c index a7f6169..12b1434 100644 --- a/tools/asm-processor/tests/static-global.c +++ b/tools/asm-processor/tests/static-global.c @@ -25,9 +25,11 @@ nop ) static int xtext(int a, int b, int c) { + static int bss2; return 1; } void baz(void) { + { static int bss2; } xtext(bss2, rodata2[0], data2[0]); } diff --git a/tools/asm-processor/tests/static-global.objdump b/tools/asm-processor/tests/static-global.objdump index a519e4f..0b21d2e 100644 --- a/tools/asm-processor/tests/static-global.objdump +++ b/tools/asm-processor/tests/static-global.objdump @@ -15,10 +15,12 @@ SYMBOL TABLE: 00000004 g O .data 00000000 data2 00000004 g O .bss 00000000 bss2 00000030 g F .text 00000000 xtext +00000008 g O .bss 00000000 bss2:1 +0000000c g O .bss 00000000 bss2:2 RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000004c R_MIPS_HI16 .bss 00000064 R_MIPS_LO16 .bss 00000050 R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/static.objdump b/tools/asm-processor/tests/static.objdump index dd62c94..a2f3638 100644 --- a/tools/asm-processor/tests/static.objdump +++ b/tools/asm-processor/tests/static.objdump @@ -18,7 +18,7 @@ SYMBOL TABLE: RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000004c R_MIPS_HI16 .bss 00000064 R_MIPS_LO16 .bss 00000050 R_MIPS_HI16 .rodata diff --git a/tools/asm-processor/tests/test1.objdump b/tools/asm-processor/tests/test1.objdump index b97ae46..af12f90 100644 --- a/tools/asm-processor/tests/test1.objdump +++ b/tools/asm-processor/tests/test1.objdump @@ -12,13 +12,13 @@ SYMBOL TABLE: 0000003c g F .text 0000003c f 00000000 g F .text 0000003c test 0000000c g .rodata 00000000 some_rodata -00000078 g F .text 00000004 g +00000078 g F .text 00000034 g 00000000 *UND* 00000000 D_410100 00000000 *UND* 00000000 func_004000B0 RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000044 R_MIPS_HI16 .rodata 00000054 R_MIPS_LO16 .rodata 00000048 R_MIPS_HI16 some_rodata diff --git a/tools/asm-processor/tests/test2.objdump b/tools/asm-processor/tests/test2.objdump index 276ed9f..968b7d0 100644 --- a/tools/asm-processor/tests/test2.objdump +++ b/tools/asm-processor/tests/test2.objdump @@ -11,12 +11,12 @@ SYMBOL TABLE: 00000010 g O .rodata 00000001 buf3 00000044 g F .text 0000007c func3 000000c4 g F .text 00000000 jumptarget -000000c0 g F .text 0000000c func4 +000000c0 g F .text 0000002c func4 0000004c g .rodata 00000000 rv RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000000 R_MIPS_HI16 .rodata 00000008 R_MIPS_LO16 .rodata 0000001c R_MIPS_HI16 .rodata @@ -30,7 +30,7 @@ OFFSET TYPE VALUE RELOCATION RECORDS FOR [.rodata]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 0000002c R_MIPS_32 .text 00000030 R_MIPS_32 .text 00000034 R_MIPS_32 .text diff --git a/tools/asm-processor/tests/test3.objdump b/tools/asm-processor/tests/test3.objdump index bfa7f6e..e1e96c2 100644 --- a/tools/asm-processor/tests/test3.objdump +++ b/tools/asm-processor/tests/test3.objdump @@ -13,14 +13,14 @@ SYMBOL TABLE: 00000008 g O .rodata 00000001 constBufInit2 0000000c g O .rodata 00000001 constBufInit3 0000003c g F .text 00000054 f -00000000 g F .text 00000004 test -00000090 g F .text 00000004 g +00000000 g F .text 0000003c test +00000090 g F .text 00000034 g 00000000 *UND* 00000000 D_410100 00000000 *UND* 00000000 func_004000B0 RELOCATION RECORDS FOR [.text]: -OFFSET TYPE VALUE +OFFSET TYPE VALUE 00000044 R_MIPS_HI16 .rodata 00000048 R_MIPS_LO16 .rodata 00000050 R_MIPS_HI16 .rodata |
