In "clinical testing for safety-monitoring or marketing purposes", "marketing purposes" doesn't mean spending money on ads and stuff like that, it means doing clinical trials to see if a drug works for a certain disease or population, or to compare their drug against a competing drug, or whatever. This is the insanely expensive research that pharma companies do to see if drugs actually work, that everyone likes to ignore when talking about greedy pharma companies.
Results of clinical trials (if successful) can then be used in ads, but that would not be R&D expenditure.