This is an archive of the discontinued LLVM Phabricator instance.

[openmp] [test] Add missing <limits> include to capacity_nthreads
ClosedPublic

Authored by mgorny on Jul 6 2021, 5:01 AM.

Details

Summary

Otherwise the build against libstdc++ fails:

$ "clang++" "-fopenmp" "-pthread" "-I" "/home/mgorny/git/llvm-project/openmp/runtime/test" "-I" "/home/mgorny/git/llvm-project/build.libomp/runtime/src" "-L" "/home/mgorny/git/llvm-project/build.libomp/runtime/src" "-I" "/home/mgorny/git/llvm-project/openmp/runtime/test/ompt" "-std=c++14" "/home/mgorny/git/llvm-project/openmp/runtime/test/tasking/hidden_helper_task/capacity_nthreads.cpp" "-o" "/home/mgorny/git/llvm-project/build.libomp/runtime/test/tasking/hidden_helper_task/Output/capacity_nthreads.cpp.tmp" "-lm" "-latomic"
# command stderr:
/home/mgorny/git/llvm-project/openmp/runtime/test/tasking/hidden_helper_task/capacity_nthreads.cpp:12:31: error: no member named 'numeric_limits' in namespace 'std'
                         std::numeric_limits<int>::max());
                         ~~~~~^
/home/mgorny/git/llvm-project/openmp/runtime/test/tasking/hidden_helper_task/capacity_nthreads.cpp:12:49: error: expected '(' for function-style cast or type construction
                         std::numeric_limits<int>::max());
                                             ~~~^
/home/mgorny/git/llvm-project/openmp/runtime/test/tasking/hidden_helper_task/capacity_nthreads.cpp:12:52: error: no member named 'max' in the global namespace
                         std::numeric_limits<int>::max());
                                                 ~~^
3 errors generated.

error: command failed with exit status: 1

Diff Detail

Event Timeline

mgorny created this revision.Jul 6 2021, 5:01 AM
mgorny requested review of this revision.Jul 6 2021, 5:01 AM
tianshilei1992 accepted this revision.Jul 6 2021, 10:33 AM

LGTM. Thanks!

This revision is now accepted and ready to land.Jul 6 2021, 10:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2021, 11:40 AM