A semiconductor device includes a first memory block having a first address space, a second memory block having a second address space which is smaller than the first address space, and a test circuit which supplies a test address and a test control signal to the first memory block and the second memory block, and tests the first memory block and the second memory block simultaneously. The second memory block has a storage circuit which stores an address corresponding to the second address space, and a control circuit which inactivates the test control signal when the test address falls outside the second address space.