NAND, OR and XOR device detection through gate test