This is an archive of the discontinued LLVM Phabricator instance.

[libc] Set include directories for str_to_float tests
ClosedPublic

Authored by phosek on Jun 30 2023, 8:39 PM.

Details

Summary

These tests use libc headers and need to explicitly include them.

Diff Detail

Event Timeline

phosek created this revision.Jun 30 2023, 8:39 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 30 2023, 8:39 PM
phosek requested review of this revision.Jun 30 2023, 8:39 PM
sivachandra accepted this revision.Jul 5 2023, 12:50 AM

OK with me but please wait for @michaelrj.

This revision is now accepted and ready to land.Jul 5 2023, 12:50 AM
michaelrj added inline comments.Jul 5 2023, 10:26 AM
libc/test/src/__support/CMakeLists.txt
126–127

This one should not use the LIBC_INCLUDE_DIR since it's intended to use the system's libc. This is to allow for accuracy and speed comparisons.

phosek updated this revision to Diff 537511.Jul 5 2023, 2:50 PM
phosek marked an inline comment as done.
michaelrj accepted this revision.Jul 7 2023, 10:43 AM
This revision was automatically updated to reflect the committed changes.
jhuber6 added a subscriber: jhuber6.Jul 7 2023, 2:09 PM

This breaks my GPU libc builds

FAILED: libc/test/src/__support/CMakeFiles/libc_str_to_float_comparison_test.dir/str_to_float_comparison_test.cpp.o 
/home/jhuber/Documents/llvm/llvm-project/build/./bin/clang++ --target=x86_64-unknown-linux-gnu -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LIBCPP_ENABLE_ASSERTIONS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/jhuber/Documents/llvm/llvm-project/build/runtimes/runtimes-bins/libc/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -O3 -DNDEBUG -std=gnu++17 -UNDEBUG -MD -MT libc/test/src/__support/CMakeFiles/libc_str_to_float_comparison_test.dir/str_to_float_comparison_test.cpp.o -MF libc/test/src/__support/CMakeFiles/libc_str_to_float_comparison_test.dir/str_to_float_comparison_test.cpp.o.d -o libc/test/src/__support/CMakeFiles/libc_str_to_float_comparison_test.dir/str_to_float_comparison_test.cpp.o -c /home/jhuber/Documents/llvm/llvm-project/libc/test/src/__support/str_to_float_comparison_test.cpp
In file included from /home/jhuber/Documents/llvm/llvm-project/libc/test/src/__support/str_to_float_comparison_test.cpp:16:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/fstream:40:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/istream:40:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/ios:44:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/bits/ios_base.h:41:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/bits/locale_classes.h:40:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/string:54:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/bits/basic_string.h:4110:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/ext/string_conversions.h:43:
In file included from /usr/lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/cstdlib:79:
/usr/include/stdlib.h:63:5: error: typedef redefinition with different types ('struct div_t' vs 'struct div_t')
   63 |   } div_t;
      |     ^
/home/jhuber/Documents/llvm/llvm-project/build/runtimes/runtimes-bins/libc/include/llvm-libc-types/div_t.h:15:3: note: previous definition is here
   15 | } div_t;
      |   ^

Among other, similar errors.