Minor work in tupfile so that libs are at the back of the ld call, and an actual testcase.