Currently, GlobalOpt will remove global values from non-discardable COMDATS (COMDATS which have at least one live object) if the value in question has local linkage.
As described in https://reviews.llvm.org/D53234, this is an invalid treatment of COMDAT members, and can lead to issues when using MD_Associated metadata.
I've modified GlobalOpt to always bail out of global value removal if the global value is in a non-discardable COMDAT.
I've also modified the associated test to check that one of its functions, which GlobalOpt currently removes due to its local linkage, is now kept.