Define survival and long term. If you are talking about survival for decades against societal collapse there is no go to gun. I would want a hand gun, a semi-auto .22, a 12 gauge shotgun an AR-15 and a good long rifle like a .308 or .300 win mag. I would want all the ammo I could beg, borrow, steal and carry; especially for the AR. The reason for all those guns is each serves a purpose. I would have the handgun and AR with me at all times. The long gun would be for knocking out obvious human predators before they got close enough to effectively shoot back. The shotgun is for bird hunting and shelter defense, the .22 would be for survival hunting up to and including deer. The pistol should be obvious.
If we are talking societal collapse for less than 5 years, I could feel comfortable with the pistol and AR, though a long rifle would be nice. Still want all the ammo I can get.
If we are talking having to get out fast but then just have to worry about wild country survival, I would probably want the .22 I always have 1,000 round or more on hand and it will get the job done even as a emergency defense weapon. (I would probably grab my .45 pistol on my way out the door 'cause I rarely have less than 200 round for it on hand as well.)
Every time I read this question I find it a bit ludicrous. If you are looking to buy that "one gun" than I would go with the AR-15. If you take good care of it, it is highly unlikely it will develop a problem in less than 10,000 rounds. If you can find a way to haul around and use 10,000 rounds you are a bigger man than I. However, I presently have 2-12 gauge shotguns, 2-.22 rifles, an AR-15, a .243, a .308, a .45 ACP and a 9mm. I have 100 rounds or more on hand for each gun at almost any time, and 1,000 rounds of .22. If the SHTF I would load up my family, fishing poles, tackle box, best hunting knives what food I have on hand, all my guns and ammo, and drive toward and as deep into the wildest area I could find. Hide the truck, walk a couple of miles deeper in and set up camp.