When a test mode signal is rendered active by a signal given from an
external terminal, a CPU reads and runs various self-testing programs
stored in a ROM. When any of the test programs comes to a process of
testing a security circuit, a security test signal is rendered active and
when a predetermined address is accessed then, a selector is switched to
a register side by the output signal of an AND circuit of a test circuit.
An illegitimate instruction, for example, is set in the register and is
given to the CPU. Whether the security circuit has failure is determined
by checking if an illegitimate access detection signal is output when the
CPU executes the illegitimate instruction.