The trial heard yesterday that police in Greenock set up Operation Evergreen to continue their hunt for the killer of Ms Doyle - whose body was found near her home in June 1986.
They tried to visit every male who had come to the attention of police since - which included John Docherty, 49, the man on trial.
They were asked for "elimination samples" which would be destroyed at the end of any court case.
Detective constable Stuart Young, 49, told how a visit to Docherty's 1986 address in May 2012 found his ex-sister-in-law living there. She gave an address in the town's Trafalgar Street.
Mr Young said he and a colleague found Docherty there and he willingly gave a DNA sample, finger-prints and allowed himself to be photographed.
The detective said Docherty signed a form agreeing: "I have been made aware I am not obliged to provide this sample and that any information from this sample may be used in evidence."
"He happily consented, immediately and without demur?" asked defence QC Donald Findlay.
"Absolutely" replied Mr Young.
Fiona McMahon, 42, who heads the specialist DNA data base team at the Scottish Police Authority lab in Dundee, said the sample from Docherty was one of 361 processed in her lab.
She told the High Court in Edinburgh she compared it with what was tagged "the crime scene profile."
Ms McMahon said: "It was a full match."
She told the trial she had also examined "elimination samples" provided by some of the "possible suspects" put forward by the defence but found no matches.
The trial heard that Docherty, now of Hunters' Quay, Holiday Village, Dunoon, was living in Greenock in 1986 but spent some time in the Army before moving back to the town.
He denies murder and claims that at the time he is alleged to have stripped and strangled Elaine Doyle, 16, he was with his parents - who are no longer alive - at their home in Anne Street.
Docherty has also lodged a so-called special defence of incrimination, claiming the culprit might be among a list of 41 names taken from files of the police investigation into the murder.
The charge alleges that on June 2, 1986 in a lane near Elaine Doyle's home in Ardgowan Street, Greenock, he seized her by the hair, struck her on the head and either removed or compelled her to remove her clothing.
The charge goes on to allege that Docherty forced Elaine to the ground, pushed her face into the ground, sat or knelt on the teenager then placed a ligature round her neck and strangled her.
Docherty also denies stealing a handbag from Ardgowan Street on the same date.
He further denies a charge of attacking another woman, Linda Hargie, on various occasions between 1990 and 1995 at an address in Anne Street, Greenock by seizing her and pushing her and punching her on the head.
The trial continues.