Testing the muon g-2 anomaly at the LHC