The system is set up to award points based on class of service (aka "bucket") in which you are ticketed. This is not to say it's the same as what you originally purchased.
A domestic first class upgrade secured with a buy up offer, SWU or points+copay puts you into the "A" bucket, which does not earn any extra points beyond your coach fare.
If, for some reason, there are IRROPS at the airport and an agent needs to rebook you or make other changes to your trip, it's possible they book you directly into "F". In those cases, people have reported getting the class of service bonus because the system credited based on what their ultimate bucket was.