Skip to content

Commit

Permalink
Fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Feb 5, 2022
1 parent f24b997 commit a4d9bc7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions test/elf/warn-once.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,19 @@ mold="$(pwd)/mold"
t=out/test/elf/$testname
mkdir -p $t

cat <<EOF | $CC -c -xc -o $t/a.o -
cat <<EOF | $CC -c -fPIC -xc -o $t/a.o -
extern int foo;
int x() { return foo; }
EOF

cat <<EOF | $CC -c -xc -o $t/b.o -
cat <<EOF | $CC -c -fPIC -xc -o $t/b.o -
extern int foo;
int y() { return foo; }
int main() {}
EOF

$CC -B. -o $t/exe $t/a.o $t/b.o -Wl,--warn-unresolved-symbols >& $t/log1
$CC -B. -o $t/exe $t/a.o $t/b.o -Wl,--warn-unresolved-symbols,--warn-once >& $t/log2
$CC -B. -o $t/exe $t/a.o $t/b.o -Wl,--warn-unresolved-symbols,--warn-once >& $t/log

[ "$(grep 'undefined symbol:.* foo$' $t/log1 | wc -l)" = 2 ]
[ "$(grep 'undefined symbol:.* foo$' $t/log2 | wc -l)" = 1 ]
[ "$(grep 'undefined symbol:.* foo$' $t/log | wc -l)" = 1 ]

echo OK

0 comments on commit a4d9bc7

Please sign in to comment.