Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Nov 7, 2023
1 parent 8c35c80 commit 0c6daad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/elf/ifunc-address-equality-exported.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ int main() {
}
EOF

$CC -B. -o $t/exe1 $t/c.o $t/b.so -no-pie
$QEMU $t/exe1 | grep -Eq '^(\S+) \1'
$CC -B. -o $t/exe $t/c.o $t/b.so -no-pie
$QEMU $t/exe | grep -Eq '^(\S+) \1'
7 changes: 5 additions & 2 deletions test/elf/ifunc-funcptr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,8 @@ int main() {
}
EOF

$CC -B. -o $t/exe $t/a.o $t/b.o $t/c.o
$QEMU $t/exe | grep -q '^3$'
$CC -B. -o $t/exe1 $t/a.o $t/b.o $t/c.o -pie
$QEMU $t/exe1 | grep -q '^3$'

$CC -B. -o $t/exe2 $t/a.o $t/b.o $t/c.o -no-pie
$QEMU $t/exe2 | grep -q '^3$'
7 changes: 5 additions & 2 deletions test/elf/ifunc-noplt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ int main() {
}
EOF

$CC -B. -o $t/exe $t/a.o
$QEMU $t/exe | grep -q 'Hello world'
$CC -B. -o $t/exe1 $t/a.o -pie
$QEMU $t/exe1 | grep -q 'Hello world'

$CC -B. -o $t/exe2 $t/a.o -no-pie
$QEMU $t/exe2 | grep -q 'Hello world'

0 comments on commit 0c6daad

Please sign in to comment.