|
| 1 | +#----------QC_E_CALL_TO_JAL.test----------------- Executable------------------# |
| 2 | +#BEGIN_COMMENT |
| 3 | +# Do relaxation from QC.E.J and QC.E.JAL to JAL or C.J/C.JAL |
| 4 | +#END_COMMENT |
| 5 | +#-------------------------------------------------------------------- |
| 6 | +REQUIRES: riscv32 |
| 7 | +RUN: %clang %clangopts -c %p/Inputs/x.s -o %t.o -menable-experimental-extensions -march=rv32gc_xqcilb0p2 |
| 8 | + |
| 9 | +# Relaxations are enabled, including compressed ones. |
| 10 | +RUN: %link %linkopts --relax-xqci %t.o -o %t.1.out -MapStyle txt -Map %t.1.map --verbose 2>&1 | %filecheck %s --check-prefix=VERBOSE_RELAX_C |
| 11 | +RUN: %link %linkopts --relax-xqci %t.o -o %t.1.so -shared -MapStyle txt -Map %t.1.so.map --verbose 2>&1 | %filecheck %s --check-prefix=VERBOSE_RELAX_C |
| 12 | +VERBOSE_RELAX_C: RISCV_QC_E_JAL_C : relaxing instruction 0x00000000c01f to compressed instruction 0x2001 for symbol f in section .text+0x4 file {{.*}}.o |
| 13 | +VERBOSE_RELAX_C: RISCV_QC_E_JAL_C : Deleting 4 bytes for symbol 'f' in section .text+0x6 file {{.*}}.o |
| 14 | +VERBOSE_RELAX_C: RISCV_QC_E_J_C : relaxing instruction 0x00000000401f to compressed instruction 0xa001 for symbol f in section .text+0x6 file {{.*}}.o |
| 15 | +VERBOSE_RELAX_C: RISCV_QC_E_J_C : Deleting 4 bytes for symbol 'f' in section .text+0x8 file {{.*}}.o |
| 16 | +VERBOSE_RELAX_C: RISCV_QC_E_JAL_C : relaxing instruction 0x00000000c01f to compressed instruction 0x2001 for symbol f in section .text+0x778 file {{.*}}.o |
| 17 | +VERBOSE_RELAX_C: RISCV_QC_E_JAL_C : Deleting 4 bytes for symbol 'f' in section .text+0x77a file {{.*}}.o |
| 18 | +VERBOSE_RELAX_C: RISCV_QC_E_J_C : relaxing instruction 0x00000000401f to compressed instruction 0xa001 for symbol f in section .text+0x77A file {{.*}}.o |
| 19 | +VERBOSE_RELAX_C: RISCV_QC_E_J_C : Deleting 4 bytes for symbol 'f' in section .text+0x77c file {{.*}}.o |
| 20 | +VERBOSE_RELAX_C: RISCV_QC_E_JAL : Deleting 2 bytes for symbol 'f' in section .text+0x874 file {{.*}}.o |
| 21 | +VERBOSE_RELAX_C: RISCV_QC_E_J : Deleting 2 bytes for symbol 'f' in section .text+0x878 file {{.*}}.o |
| 22 | +VERBOSE_RELAX_C: RISCV_QC_E_JAL : Deleting 2 bytes for symbol 'f' in section .text+0xffef0 file {{.*}}.o |
| 23 | +VERBOSE_RELAX_C: RISCV_QC_E_J : Deleting 2 bytes for symbol 'f' in section .text+0xffef4 file {{.*}}.o |
| 24 | +VERBOSE_RELAX_C: RISCV_QC_E_CALL : Cannot relax 2 bytes for symbol 'f' in section .text+0x1000e8 file {{.*}}.o |
| 25 | +VERBOSE_RELAX_C: RISCV_QC_E_CALL : Cannot relax 2 bytes for symbol 'f' in section .text+0x1000ee file {{.*}}.o |
| 26 | + |
| 27 | +RUN: %objdump -d %t.1.out 2>&1 | %filecheck %s --check-prefix=DUMP_RELAX_C |
| 28 | +RUN: %objdump -d %t.1.so 2>&1 | %filecheck %s --check-prefix=DUMP_RELAX_C |
| 29 | +DUMP_RELAX_C: 3ff5 jal 0x{{[[:xdigit:]]+}} <f> |
| 30 | +DUMP_RELAX_C: bfed j 0x{{[[:xdigit:]]+}} <f> |
| 31 | +DUMP_RELAX_C: 3061 jal 0x{{[[:xdigit:]]+}} <f> |
| 32 | +DUMP_RELAX_C: b059 j 0x{{[[:xdigit:]]+}} <f> |
| 33 | +DUMP_RELAX_C: f90ff0ef jal 0x{{[[:xdigit:]]+}} <f> |
| 34 | +DUMP_RELAX_C: f8cff06f j 0x{{[[:xdigit:]]+}} <f> |
| 35 | +DUMP_RELAX_C: 914000ef jal 0x{{[[:xdigit:]]+}} <f> |
| 36 | +DUMP_RELAX_C: 9100006f j 0x{{[[:xdigit:]]+}} <f> |
| 37 | +DUMP_RELAX_C: cc9f f00e ffef qc.e.jal 0x{{[[:xdigit:]]+}} <f> |
| 38 | +DUMP_RELAX_C: 499f f00e ffef qc.e.j 0x{{[[:xdigit:]]+}} <f> |
| 39 | + |
| 40 | +RUN: %filecheck %s --input-file=%t.1.map --check-prefix=MAP_RELAX_C |
| 41 | +RUN: %filecheck %s --input-file=%t.1.so.map --check-prefix=MAP_RELAX_C |
| 42 | +MAP_RELAX_C: # LinkStats Begin |
| 43 | +MAP_RELAX_C: # RelaxationBytesDeleted : 24 |
| 44 | +MAP_RELAX_C: # RelaxationBytesMissed : 4 |
| 45 | +MAP_RELAX_C: # LinkStats End |
| 46 | + |
| 47 | +MAP_RELAX_C: .text {{.+}}, Alignment: 0x2, Flags: SHF_ALLOC|SHF_EXECINSTR, Type: SHT_PROGBITS |
| 48 | +MAP_RELAX_C: # RelaxationBytesDeleted : 24 |
| 49 | +MAP_RELAX_C: # RelaxationBytesMissed : 4 |
| 50 | +MAP_RELAX_C: .text {{.+}}.o #SHT_PROGBITS,SHF_ALLOC|SHF_EXECINSTR,2 |
| 51 | + |
| 52 | +# Only non-compressed relaxations are enabled. |
| 53 | +RUN: %link %linkopts --relax-xqci --no-relax-c %t.o -o %t.2.out -MapStyle txt -Map %t.2.map --verbose 2>&1 | %filecheck %s --check-prefix=VERBOSE_RELAX |
| 54 | +RUN: %link %linkopts --relax-xqci --no-relax-c %t.o -o %t.2.so -shared -MapStyle txt -Map %t.2.so.map --verbose 2>&1 | %filecheck %s --check-prefix=VERBOSE_RELAX |
| 55 | +VERBOSE_RELAX: RISCV_QC_E_JAL : Deleting 2 bytes for symbol 'f' in section .text+0x8 file {{.*}}.o |
| 56 | +VERBOSE_RELAX: RISCV_QC_E_J : Deleting 2 bytes for symbol 'f' in section .text+0xc file {{.*}}.o |
| 57 | +VERBOSE_RELAX: RISCV_QC_E_JAL : Deleting 2 bytes for symbol 'f' in section .text+0x780 file {{.*}}.o |
| 58 | +VERBOSE_RELAX: RISCV_QC_E_J : Deleting 2 bytes for symbol 'f' in section .text+0x784 file {{.*}}.o |
| 59 | +VERBOSE_RELAX: RISCV_QC_E_JAL : Deleting 2 bytes for symbol 'f' in section .text+0x87c file {{.*}}.o |
| 60 | +VERBOSE_RELAX: RISCV_QC_E_J : Deleting 2 bytes for symbol 'f' in section .text+0x880 file {{.*}}.o |
| 61 | +VERBOSE_RELAX: RISCV_QC_E_JAL : Deleting 2 bytes for symbol 'f' in section .text+0xffef8 file {{.*}}.o |
| 62 | +VERBOSE_RELAX: RISCV_QC_E_J : Deleting 2 bytes for symbol 'f' in section .text+0xffefc file {{.*}}.o |
| 63 | +VERBOSE_RELAX: RISCV_QC_E_CALL : Cannot relax 2 bytes for symbol 'f' in section .text+0x1000f0 file {{.*}}.o |
| 64 | +VERBOSE_RELAX: RISCV_QC_E_CALL : Cannot relax 2 bytes for symbol 'f' in section .text+0x1000f6 file {{.*}}.o |
| 65 | + |
| 66 | +RUN: %objdump -d %t.2.out 2>&1 | %filecheck %s --check-prefix=DUMP_RELAX |
| 67 | +RUN: %objdump -d %t.2.so 2>&1 | %filecheck %s --check-prefix=DUMP_RELAX |
| 68 | +DUMP_RELAX: ffdff0ef jal 0x{{[[:xdigit:]]+}} <f> |
| 69 | +DUMP_RELAX: ff9ff06f j 0x{{[[:xdigit:]]+}} <f> |
| 70 | +DUMP_RELAX: 885ff0ef jal 0x{{[[:xdigit:]]+}} <f> |
| 71 | +DUMP_RELAX: 881ff06f j 0x{{[[:xdigit:]]+}} <f> |
| 72 | +DUMP_RELAX: f88ff0ef jal 0x{{[[:xdigit:]]+}} <f> |
| 73 | +DUMP_RELAX: f84ff06f j 0x{{[[:xdigit:]]+}} <f> |
| 74 | +DUMP_RELAX: 90c000ef jal 0x{{[[:xdigit:]]+}} <f> |
| 75 | +DUMP_RELAX: 9080006f j 0x{{[[:xdigit:]]+}} <f> |
| 76 | +DUMP_RELAX: c89f f00e ffef qc.e.jal 0x{{[[:xdigit:]]+}} <f> |
| 77 | +DUMP_RELAX: 459f f00e ffef qc.e.j 0x{{[[:xdigit:]]+}} <f> |
| 78 | + |
| 79 | +RUN: %filecheck %s --input-file=%t.2.map --check-prefix=MAP_RELAX |
| 80 | +RUN: %filecheck %s --input-file=%t.2.so.map --check-prefix=MAP_RELAX |
| 81 | +MAP_RELAX: # LinkStats Begin |
| 82 | +MAP_RELAX: # RelaxationBytesDeleted : 16 |
| 83 | +MAP_RELAX: # LinkStats End |
| 84 | + |
| 85 | +MAP_RELAX: .text {{.+}}, Alignment: 0x2, Flags: SHF_ALLOC|SHF_EXECINSTR, Type: SHT_PROGBITS |
| 86 | +MAP_RELAX: # RelaxationBytesDeleted : 16 |
| 87 | +MAP_RELAX: .text {{.+}}.o #SHT_PROGBITS,SHF_ALLOC|SHF_EXECINSTR,2 |
| 88 | + |
| 89 | +### Relaxations are disabled. |
| 90 | +RUN: %link %linkopts --no-relax-xqci --no-relax %t.o -o %t.3.out -MapStyle txt -Map %t.3.map --verbose 2>&1 | %filecheck %s --check-prefix=VERBOSE_NORELAX |
| 91 | +RUN: %link %linkopts --no-relax-xqci --no-relax %t.o -o %t.3.so -shared -MapStyle txt -Map %t.3.so.map --verbose 2>&1 | %filecheck %s --check-prefix=VERBOSE_NORELAX |
| 92 | +VERBOSE_NORELAX-COUNT-10: RISCV_QC_E_CALL : Cannot relax |
| 93 | +VERBOSE_NORELAX-NOT: Deleting |
| 94 | + |
| 95 | +RUN: %objdump -d %t.3.out 2>&1 | %filecheck %s --check-prefix=DUMP_NORELAX |
| 96 | +RUN: %objdump -d %t.3.so 2>&1 | %filecheck %s --check-prefix=DUMP_NORELAX |
| 97 | +DUMP_NORELAX: qc.e.jal |
| 98 | +DUMP_NORELAX: qc.e.j |
| 99 | +DUMP_NORELAX: qc.e.jal |
| 100 | +DUMP_NORELAX: qc.e.j |
| 101 | +DUMP_NORELAX: qc.e.jal |
| 102 | +DUMP_NORELAX: qc.e.j |
| 103 | +DUMP_NORELAX: qc.e.jal |
| 104 | +DUMP_NORELAX: qc.e.j |
| 105 | +DUMP_NORELAX: qc.e.jal |
| 106 | +DUMP_NORELAX: qc.e.j |
| 107 | + |
| 108 | +RUN: %filecheck %s --input-file=%t.3.map --check-prefix=MAP_NORELAX |
| 109 | +RUN: %filecheck %s --input-file=%t.3.so.map --check-prefix=MAP_NORELAX |
| 110 | +MAP_NORELAX: # LinkStats Begin |
| 111 | +MAP_NORELAX-NOT: # RelaxationBytesDeleted |
| 112 | +MAP_NORELAX: # LinkStats End |
| 113 | + |
| 114 | +MAP_NORELAX: .text {{.+}}, Alignment: 0x2, Flags: SHF_ALLOC|SHF_EXECINSTR, Type: SHT_PROGBITS |
| 115 | +MAP_NORELAX-NOT: # RelaxationBytesDeleted |
| 116 | +MAP_NORELAX: .text {{.+}}.o #SHT_PROGBITS,SHF_ALLOC|SHF_EXECINSTR,2 |
0 commit comments