add case function to top level compilation unit