Genes with male- and testis-enriched expression are under-represented on the Drosophila melanogaster X chromosome. There is also an excess of retrotransposed genes, many of which are expressed in testis, that have "escaped" the X chromosome and moved to the autosomes. It has been proposed that inactivation of the X chromosome during spermatogenesis contributes to these patterns: genes with a beneficial function late in spermatogenesis should be selectively favored to be autosomal in order to avoid inactivation. However, conclusive evidence for X inactivation in the male germline has been lacking. To test for such inactivation, we used a transgenic construct in which expression of a lacZ reporter gene was driven by the promoter sequence of the autosomal, testis-specific ocnus gene. Autosomal insertions of this transgene showed the expected pattern of male- and testis-specific expression. X-linked insertions, in contrast, showed only very low levels of reporter gene expression. Thus, we find that X linkage inhibits the activity of a testis-specific promoter. We obtained the same result using a vector in which the transgene was flanked by chromosomal insulator sequences. These results are consistent with global inactivation of the X chromosome in the male germline and support a selective explanation for X chromosome avoidance of genes with beneficial effects late in spermatogenesis.