So, even if being bombarded the infantry will form square if enemy cavalry appears?
What if the enemy doesn't have cavalry support because it's routed, destroyed or detached?
Yes to first question and for the second one :
a message will be delivered by the AI to another Corp nearby for assistance asking support.
It would be unlucky if there was cavalry nowhere. Your infantry can also be support by artillery that can targetted cavalry as a main threat and brokes its charge. Now, if there is neither cavalry nor artillery in your corp or the nearby ones to support the infantry, well, I think you are in a critical position.