1 /* { dg-do compile } */
2 /* { dg-require-effective-target pthread } */
3 /* { dg-options "-Og --coverage -pthread -fdump-tree-optimized -std=c++17" } */
4 using uint16_t = unsigned short;
18 auto htons = [](uint16_t s) {
19 if (__builtin_constant_p(s)) {
20 return uint16_t(uint16_t(s >> 8) | uint16_t(s << 8));
22 return uint16_t(uint16_t(s >> 8) | uint16_t(s << 8));
39 /* { dg-final { scan-tree-dump-not "builtin_unreachable" "optimized"} } */