Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Jan 14, 2025
1 parent c6c12d4 commit 500416f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
30 changes: 0 additions & 30 deletions test/arch-riscv64-norvc.sh

This file was deleted.

31 changes: 31 additions & 0 deletions test/arch-riscv64-relax-j.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
. $(dirname $0)/common.inc

cat <<EOF | $CC -o $t/a.o -c -xc - -O2 -march=rv64g
void g() {}
EOF

cat <<EOF | $CC -o $t/b.o -c -xc - -O2 -march=rv64g
void g();
void f() { g(); }
int main() { f(0); }
EOF

$CC -B. -march=rv64g -o $t/exe1 $t/a.o $t/b.o
$QEMU $t/exe1
$OBJDUMP -d $t/exe1 | grep -Eq '\bj\b.*<g>'


cat <<EOF | $CC -o $t/c.o -c -xc - -O2 -march=rv64gc
void g() {}
EOF

cat <<EOF | $CC -o $t/d.o -c -xc - -O2 -march=rv64gc
void g();
void f() { g(); }
int main() { f(0); }
EOF

$CC -B. -march=rv64g -o $t/exe2 $t/c.o $t/d.o
$QEMU $t/exe2
$OBJDUMP -d $t/exe2 | grep -Eq '\bj\b.*<g>'

0 comments on commit 500416f

Please sign in to comment.