Aliphatic/aromatic primary amines are heated with chloroform/alcoholic KOH to form foul smelling alkyl isocyanides or carbylamines. This test is not given by secondary/tertiary amines.
R−NH2+CHCl3+3KOHΔ−→R−NC+3KCl+3H2O
For example, ethylamine gives ethyl isocyanide.
C2H5−NH2+CHCl3+3KOHΔ−→C2H5−NC+3KCl+3H2O