I've also read comments from doctors suggesting that hydroxychloroquine has been studied in the past as a potential prophylactic for viral infections. A search through US clinical trials yields many results which mention this drug in connection to lupus, arthritis, and cancer. But I have yet to find completed clinical trials which revolve around viral infections - does this exist somewhere or has this never been studied?
The only double blind randomised clinical trial I am aware of is this one, examining the use of hydroxychloroquine for the treatment of HIV-1-infected patients. It finds significant reductions in viral load, but not improvement of CD4+ counts. How much change could be expected in 8 weeks I do not know. There are in vitro studies, such as this one looking at dengue virus.
In combination with azithromycin it has been examined for the use in COVID-19 (pre-print, not peer reviewed), but without a control group I find it hard to call it a clinical trial, and there are other criticisms of the work.