1 // PR c++/43680 2 // Test that we don't make excessively aggressive assumptions about what 3 // values an enum variable can have. 4 // { dg-do run { target fpic } } 5 // { dg-options "-O2 -fPIC" } 6 7 extern "C" void abort (); 8 9 enum E { A, B, C, D }; 10 11 void CheckE(const E value)12CheckE(const E value) 13 { 14 long v = value; 15 if (v <= D) 16 abort (); 17 } 18 main()19int main() { 20 CheckE(static_cast<E>(5)); 21 } 22