likely.cxx 259 B

123456789101112131415
  1. // Test for C++20 [[likely]] and [[unlikely]] attributes.
  2. int main(int argc, char **)
  3. {
  4. #if __cplusplus < 202002L
  5. deliberately_fail(because, older, C++, standard);
  6. #endif
  7. int x = 0;
  8. if (argc == 1) [[likely]]
  9. x = 0;
  10. else
  11. x = 1;
  12. return x;
  13. }