Verify that attributes are not lost during linking.

We don't want to lose attributes when a function decl without them is merged
with a function decl that has them.
PR2382