Many plantation owners dragged their slaves along for the ride when the battles began. Some were forced to fight, others were forced to make cannons and fortifications. So I slightly correct my statement as not all slaves were on the front lines but I believe there were around 6-7000 slaves supporting the confederate army.
The emancipation proclamation kind of rattled that cage a bit, causing many slaves to run away with some even joining the union army to fight back. The disarray really screwed with confederate morale and led to huge losses of territory in battle.