There has been much debate concerning whether cis-regulatory or coding changes are more likely to produce evolutionary innovation or adaptation in gene function, but an additional complication is that some genes can dramatically diverge through alternative splicing, increasing the diversity of gene function within a locus. The fruitless gene is a major transcription factor with a wide range of pleiotropic functions, including a fundamental conserved role in sexual differentiation, species-specific morphology and an important influence on male sexual behaviour. Here, we examine the structure of fruitless in multiple species of Drosophila, and determine the patterns of selective constraint acting across the coding region. We found that the pattern of selection, estimated from the ratio of non-synonymous to synonymous substitutions, varied considerably across the gene, with most regions of the gene evolutionarily conserved but with several regions showing evidence of divergence as a result of positive selection. The regions that showed evidence of positive selection were found to be localised to relatively consistent regions across multiple speciation events, and are associated with alternative splicing. Alternative splicing may thus provide a route to gene diversification in key regulatory loci.