A timing generating circuit generates a control clock (1) and a test clock (2) based on an externally input clock CLK, and outputs the generated clocks to a testing circuit. The control clock (1) is a signal the phase of which is delayed by a predetermined amount with reference to the clock CLK. This predetermined amount can be set/changed with an external test signal. The test clock (2) is nearly an inversion signal of the clock CLK. The testing circuit generates various types of control signals (4) based on either of the clocks (1) and (2), and distributes the signals to a controlling circuit. Which of the clocks (1) and (2) is selected in the testing circuit can be set with an external test signal.