The answer is complicated by whether the conditions under which you loaned money to your own corporation make the loan a business debt or a non-business debt. Although you might think of it as business debt simply because it is related to a business, that does not make it business debt from your personal tax situation. In many cases, it would be characterized as non-business debt.
The loss on both is deductible, but the non-business bad debt would be a long term capital loss, which must first offset capital gains and then can be deducted from your ordinary income (on Schedule D) at the rate of $3000 per year until it is used up.