4 -mkdir -p $(TMPDIR)/good
5 -mkdir -p $(TMPDIR)/bad
6 $(BARE_RUSTC) ./good/lib.rs -C prefer-dynamic --out-dir="$(TMPDIR)/good"
7 $(BARE_RUSTC) ./bad/lib.rs -C prefer-dynamic --out-dir="$(TMPDIR)/bad"
8 $(BARE_RUSTC) -L "$(TMPDIR)/good" -C prefer-dynamic -Crpath ./main.rs --out-dir="$(TMPDIR)"
9 # This should succeed because the correct library is in LD_LIBRARY_PATH
10 $(LD_LIB_PATH_ENVVAR)="$(TMPDIR)/good:$($(LD_LIB_PATH_ENVVAR))" $(TMPDIR)/main
11 # This should fail because the wrong library is in LD_LIBRARY_PATH
12 OUTPUT=`$(LD_LIB_PATH_ENVVAR)="$(TMPDIR)/bad:$($(LD_LIB_PATH_ENVVAR))" $(TMPDIR)/main || exit 0`
13 if ["$(OUTPUT)" == "bad"]; then exit 1; fi