There are earlier movies that have something similar – The Slime People and The Bubble (aka The Fantastic Invasion of Planet Earth, but they’re from the early 1960s. If it’s a 1980s movie, the already-given Total Recall is probably right (especially if it’s got Arnold in it.)
They obviously didn’t understand that terraforming Mars would be such a hazard, they should have flipped the switch to the alien machine much sooner! I love how after they did finally flip the switch it took a whole 5 minutes for the whole of mars to have a breathable atmosphere.