2 * Copyright (c) 2013 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * This test ensures that the PNaCl backends can deal with C++11's
20 #define STR(A) STR_(A)
22 #define CHECK_NE(LHS, RHS, MSG) do { \
23 printf("\t" MSG ":\t" STR(LHS) "=%" PRIu64 \
24 " and " STR(RHS) "=%" PRIu64 "\n", \
25 (uint64_t)(LHS), (uint64_t)(RHS)); \
26 if ((LHS) == (RHS)) { \
27 fprintf(stderr, "ERROR: " MSG ": `" \
28 STR(LHS) " == " STR(RHS) "` " \
34 // std::thread::hardware_concurrency returns 0 if not computable or not
35 // well defined, and a hint about the number of hardware thread contexts
37 void test_hardware_concurrency() {
38 CHECK_NE(std::thread::hardware_concurrency(), 0,
39 "NaCl should know the platform's hardware concurrency");
42 // TODO(jfb) Test the rest of C++11 <thread>.
45 test_hardware_concurrency();