Add test_minmax that checks different comparisons when nans and infs are related.

At this time, does not work either in old compiler or fastcomp, but they fail due to different reasons.