HIVE-8535: add UT for compile time optimization