Rather than testing that a constant expression produces so many instructions, test that a variety of of such expressions produce the same number of instructions. This will make future changes in the compiler less likely to break this test.