#!/bin/bash set -e cd $(dirname $0) echo -n "Testing $(basename -s .sh $0) ... " t=$(pwd)/tmp/$(basename -s .sh $0) mkdir -p $t cat < $t/a.ver ver1 { global: f*o; local: *; }; ver2 { global: b*; }; EOF cat < $t/b.s .globl foo, bar, baz foo: ret bar: ret baz: ret EOF clang -fuse-ld=`pwd`/../mold -shared -o $t/c.so -Wl,-version-script,$t/a.ver $t/b.s cat < $t/log fgrep -q 'foo@ver1' $t/log fgrep -q 'bar@ver2' $t/log fgrep -q 'baz@ver2' $t/log echo OK