[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-14 Thread Zero Omega via cfe-commits

zeroomega wrote:

> Ok, seems like the only problem is the MemProf unit test 
> compiler-rt/lib/memprof/tests/
> 
> So if I manually disable that I don't see any other failures with this patch.

I think any components that uses freshly built clang (stage1) could potentially 
run into this problem again, the correct way to solve it is to provide a 
compatible C++ Library to the freshly built clang when it built compiler-rt and 
related tests. For example, use -D with `RUNTIMES_${target}_CMAKE_CXX_FLAGS` 
and `RUNTIMES_${target}_CMAKE_CXX_FLAGS` to pass `--gcc-toolchain` (it might be 
deprecated and there is an updated flag for it) to the runtimes build. This 
will probably allow stage1 clang to use gcc's stdlib like your bootstrap clang.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-13 Thread Zero Omega via cfe-commits

zeroomega wrote:

Relanded as a866ce789eb99da4d7a486eeb60a53be6c75f4fd. I will monitor the bots 
and manually trigger clean build if linker error appears again.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-13 Thread Zero Omega via cfe-commits

zeroomega wrote:

I look through all the bot failures from my mail box and I think so far there 
are two issues:

* `error: unused function 'operator<<'` issue, this is caused by a type 
matching bug I introduced in the roll and it will be addressed by: 
https://github.com/llvm/llvm-project/commit/c7e1a49754b69f548b9839a3fc1eac2d50c6b49d
 
* Linker error and SEGV in runtimes bots (e.g. 
https://lab.llvm.org/buildbot/#/builders/240/builds/15001 
andhttps://lab.llvm.org/buildbot/#/builders/239/builds/3686). These are caused 
by an incremental build bug in runtimes build. I can reproduce these errors 
locally on my machine if I do an incremental build after the roll and the issue 
is cleared if I did a clean build. I filed bug: 
https://github.com/llvm/llvm-project/issues/66272

I plan to reland the roll after it passes more local tests. For the incremental 
build bug, I plan to manually trigger a clean build once these runtimes bots 
pick up my change. Please let me know if you have questions and comments. 

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-12 Thread Zero Omega via cfe-commits

zeroomega wrote:

I looked into the "unused functions" issue shown up in bots like: 
https://lab.llvm.org/buildbot/#/builders/57/builds/29853 .

The root cause is that GoogleTest changed the way it converts an arbitrary 
object into string. In the past, any object that cannot be printed to the 
string will eventually matched to function at 
https://github.com/llvm/llvm-project/blob/58d50b0cadafe118faf2e7d7bf738d2daa38bb73/third-party/unittest/googletest/include/gtest/gtest-printers.h#L264
 . Then the call to the llvm_gtest::printable will use `OS << V.V;` to print 
the value to the stream, if the object overrides its `<<` operator, like 
https://github.com/llvm/llvm-project/blob/58d50b0cadafe118faf2e7d7bf738d2daa38bb73/clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp#L457
 , it will be used to convert the object to string. If not, a build error will 
happen. In GoogleTest v1.14.0, the object to string logic is re-written and for 
an arbitrary  object, it will eventually matched to `RawBytesPrinter` defined 
at 
https://github.com/llvm/llvm-project/blob/54c1a9b20d89e85cd60d002c77b34c00f36520f4/third-party/unittest/googletest/include/gtest/gtest-printers.h#L290
 . Therefore, the `operator<<` override won't be used and a unused function 
warnig(error) will be thrown. 

So deleting these `llvm::raw_ostream <<` functions won't cause any 
test failure but it will degrade the error message output since now the objects 
were printed as raw bytes. @bogner FYI.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-12 Thread Zero Omega via cfe-commits

zeroomega wrote:

> I'm seeing some unused functions in files that haven't been changed in years, 
> which I'm guessing come from this update - did the new googletest change how 
> custom output works?
> 
> ```
> llvm/unittests/Support/JSONTest.cpp:490:27: error: unused function 
> 'operator<<' [-Werror,-Wunused-function]
> inline llvm::raw_ostream <<(llvm::raw_ostream ,
>   ^
> 1 error generated.
> ```
> 
> I guess we can just delete this function, but I'm not sure if it means we've 
> degraded the error messages for these tests or anything like that.

Yes new gtest changes how customized function work. These functions either need 
to be deleted or revised.

I plan to revert this roll as I am seeing some linker error in bots:

```
FAILED: compiler-rt/lib/fuzzer/tests/FuzzerUtils-aarch64-Test 
/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/runtimes/runtimes-bins/compiler-rt/lib/fuzzer/tests/FuzzerUtils-aarch64-Test
cd 
/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/runtimes/runtimes-bins/compiler-rt/lib/fuzzer/tests
 && /b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/./bin/clang++ 
FuzzedDataProviderTestObjects.FuzzedDataProviderUnittest.cpp.aarch64.o 
FuzzedDataProviderTestObjects.gtest-all.cc.aarch64.o -o 
/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/runtimes/runtimes-bins/compiler-rt/lib/fuzzer/tests/./FuzzerUtils-aarch64-Test
 -fuse-ld=lld -Wl,--color-diagnostics -Wthread-safety -Wthread-safety-reference 
-Wthread-safety-beta --driver-mode=g++ -lpthread -nostdlib++ -fno-exceptions 
/b/sanitizer-aarch64-linux-fuzzer/build/llvm_build0/runtimes/runtimes-bins/compiler-rt/lib/fuzzer/libcxx_fuzzer_aarch64/lib/libc++.a
 -march=armv8-a
ld.lld: error: undefined symbol: 
testing::internal2::PrintBytesInObjectTo(unsigned char const*, unsigned long, 
std::__Fuzzer::basic_ostream>*)
>>> referenced by gtest-printers.h:158 
>>> (/b/sanitizer-aarch64-linux-fuzzer/build/llvm-project/runtimes/../third-party/unittest/googletest/include/gtest/gtest-printers.h:158)
>>>   
>>> FuzzedDataProviderTestObjects.FuzzedDataProviderUnittest.cpp.aarch64.o:(std::__Fuzzer::basic_string>>  std::__Fuzzer::char_traits, std::__Fuzzer::allocator> 
>>> testing::internal::FormatForComparisonFailureMessage>>  
>>> FuzzedDataProvider_ConsumeEnum_Test::TestBody()::Enum>(FuzzedDataProvider_ConsumeEnum_Test::TestBody()::Enum
>>>  const&, FuzzedDataProvider_ConsumeEnum_Test::TestBody()::Enum const&))
clang++: error: linker command failed with exit code 1 (use -v to see 
invocation)
```

It will need some time to debug.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-12 Thread Zero Omega via cfe-commits

zeroomega wrote:

First bot failure: https://lab.llvm.org/buildbot/#/builders/127/builds/55068

```
[18/126] Generating SANITIZER_TEST_OBJECTS.sanitizer_lzw_test.cpp.x86_64.o
FAILED: 
projects/compiler-rt/lib/sanitizer_common/tests/SANITIZER_TEST_OBJECTS.sanitizer_lzw_test.cpp.x86_64.o
 
C:/b/slave/sanitizer-windows/build/stage1/projects/compiler-rt/lib/sanitizer_common/tests/SANITIZER_TEST_OBJECTS.sanitizer_lzw_test.cpp.x86_64.o
 
cmd.exe /C "cd /D 
C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\lib\sanitizer_common\tests
 && C:\b\slave\sanitizer-windows\build\stage1\.\bin\clang.exe 
-DGTEST_NO_LLVM_SUPPORT=1 -DGTEST_HAS_RTTI=0 
-IC:/b/slave/sanitizer-windows/llvm-project/llvm/../third-party/unittest/googletest/include
 
-IC:/b/slave/sanitizer-windows/llvm-project/llvm/../third-party/unittest/googletest
 -Wno-deprecated-declarations -DGTEST_NO_LLVM_SUPPORT=1 -DGTEST_HAS_RTTI=0 
-IC:/b/slave/sanitizer-windows/llvm-project/llvm/../third-party/unittest/googlemock/include
 
-IC:/b/slave/sanitizer-windows/llvm-project/llvm/../third-party/unittest/googlemock
 -IC:/b/slave/sanitizer-windows/llvm-project/compiler-rt/include 
-IC:/b/slave/sanitizer-windows/llvm-project/compiler-rt/lib 
-IC:/b/slave/sanitizer-windows/llvm-project/compiler-rt/lib/sanitizer_common 
-DSANITIZER_COMMON_NO_REDEFINE_BUILTINS -fno-rtti -O2 -Werror=sign-compare 
-Wno-gnu-zero-variadic-macro-arguments -gline-tables-only -gcodeview -c -o 
SANITIZER_TEST_OBJECTS.sanitizer_lzw_test.cpp.x86_64.o 
C:/b/slave/sanitizer-windows/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_lzw_test.cpp"
C:/b/slave/sanitizer-windows/llvm-project/compiler-rt/lib/sanitizer_common/tests/sanitizer_lzw_test.cpp:22:10:
 error: no member named 'generate' in namespace 'std'
   22 | std::generate(data.begin(), data.end(), gen);
  | ~^
```
Probably caused by missing include header. Looking into it.


https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-12 Thread Zero Omega via cfe-commits

https://github.com/zeroomega closed 
https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits

zeroomega wrote:

I have locally tested this PR using gcc 12.2.0 on Linux x64 and MSVC from 
VS2019, both passed without issues. @pogo59 Do you have any concerns or 
suggestions before we merge this?

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits

zeroomega wrote:

I have addressed all review comments in the the latest amend commits. Please 
take a look. 

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits


@@ -10,14 +10,10 @@ Cleaned up as follows:
 # Remove all the unnecessary files and directories
 $ rm -f CMakeLists.txt configure* Makefile* CHANGES CONTRIBUTORS README 
README.md .gitignore
 $ rm -rf build-aux make msvc scripts test docs
-$ rm -f `find . -name \*\.pump`
 $ rm -f src/gmock_main.cc
 
 # Put the license in the consistent place for LLVM.
 $ mv LICENSE LICENSE.TXT
 
 Modified as follows:
 * Support for std::begin/std::end in gmock-matchers.h

zeroomega wrote:

I put the local changes into commented blocks in change in amend commit: 
2fe51a37bad9fc6aa08f09b4b6f137034e2c8140 in this PR, please take a look.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits

https://github.com/zeroomega resolved 
https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits


@@ -1,22 +1,21 @@
 LLVM notes
 --
 
-This directory contains Google Test 1.10.0, with all elements removed except 
for
-the actual source code, to minimize the addition to the LLVM distribution.
+This directory contains Google Test 1.14.0,
+revision `f8d7d77c06936315286eb55f8de22cd23c188571`, with all elements removed
+except for the actual source code, to minimize the addition to the LLVM
+distribution.
 
 Cleaned up as follows:
 
 # Remove all the unnecessary files and directories
 $ rm -f CMakeLists.txt configure* Makefile* CHANGES CONTRIBUTORS README 
README.md .gitignore
 $ rm -rf build-aux cmake codegear m4 make msvc samples scripts test xcode docs
-$ rm -f `find . -name \*\.pump`
 $ rm -f src/gtest_main.cc
 
 # Put the license in the consistent place for LLVM.
 $ mv LICENSE LICENSE.TXT
 
 Modified as follows:
-* Added support for NetBSD, Minix and Haiku.
 * Added raw_os_ostream support to 
include/gtest/internal/custom/gtest-printers.h.
 * Added StringRef support to include/gtest/internal/custom/gtest-printers.h.

zeroomega wrote:

I added a description for the these two headers.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits


@@ -77,18 +77,18 @@ endif ()
 target_include_directories(llvm_gtest
   PUBLIC $
  $
- $
- $
+ $
+ $

zeroomega wrote:

My checkout just stales. Thanks for pointing it out.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits


@@ -77,18 +77,18 @@ endif ()
 target_include_directories(llvm_gtest
   PUBLIC $
  $
- $
- $
+ $
+ $
   PRIVATE googletest googlemock
   )
 
 add_subdirectory(UnitTestMain)
 
 if (LLVM_INSTALL_GTEST)
   install(TARGETS llvm_gtest llvm_gtest_main LLVMTestingSupport 
LLVMTestingAnnotations
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT llvm_gtest)
-  install(DIRECTORY googletest/include/gtest/ DESTINATION 
"${CMAKE_INSTALL_INCLUDEDIR}/llvm-gtest/gtest/" COMPONENT llvm_gtest)
-  install(DIRECTORY googlemock/include/gmock/ DESTINATION 
"${CMAKE_INSTALL_INCLUDEDIR}/llvm-gmock/gmock/" COMPONENT llvm_gtest)
+ ARCHIVE DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT llvm_gtest)
+  install(DIRECTORY googletest/include/gtest/ DESTINATION 
include/llvm-gtest/gtest/ COMPONENT llvm_gtest)
+  install(DIRECTORY googlemock/include/gmock/ DESTINATION 
include/llvm-gmock/gmock/ COMPONENT llvm_gtest)

zeroomega wrote:

My checkout just stales. Thanks for pointing it out.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits


@@ -1,22 +1,21 @@
 LLVM notes
 --
 
-This directory contains Google Test 1.10.0, with all elements removed except 
for
-the actual source code, to minimize the addition to the LLVM distribution.
+This directory contains Google Test 1.14.0,
+revision `f8d7d77c06936315286eb55f8de22cd23c188571`, with all elements removed

zeroomega wrote:

v1.14.0 is a valid tag and `f8d7d77c06936315286eb55f8de22cd23c188571` is the 
revision that it resolves to. The content matches the 1.14.0 source tar ball. 
The reason that I include a hash here is because the previous roll v1.10.0 
doesn't have a valid tag and I had a bit hard time to find the correct revision 
for doing a diff to see what LLVM have patched. Since v1.14.0 is a valid tag, I 
think it is appropriate to remove the hash and just leave v1.14.0 in the doc. 

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-11 Thread Zero Omega via cfe-commits


@@ -10,14 +10,10 @@ Cleaned up as follows:
 # Remove all the unnecessary files and directories
 $ rm -f CMakeLists.txt configure* Makefile* CHANGES CONTRIBUTORS README 
README.md .gitignore
 $ rm -rf build-aux make msvc scripts test docs
-$ rm -f `find . -name \*\.pump`
 $ rm -f src/gmock_main.cc
 
 # Put the license in the consistent place for LLVM.
 $ mv LICENSE LICENSE.TXT
 
 Modified as follows:
 * Support for std::begin/std::end in gmock-matchers.h

zeroomega wrote:

Yes, gmock-matchers.h still have this part patched, see 
https://gist.github.com/zeroomega/fb24b1d1c4252b852200e15fda29384d#file-gtest_llvm_modification-patch-L251
 . When locally test it, without the patch, LLVM unit tests will have build 
errors.

https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-08 Thread Zero Omega via cfe-commits

https://github.com/zeroomega review_requested 
https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-08 Thread Zero Omega via cfe-commits

https://github.com/zeroomega review_requested 
https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-08 Thread Zero Omega via cfe-commits

https://github.com/zeroomega review_requested 
https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang] Update GoogleTest to v1.14.0 (PR #65823)

2023-09-08 Thread Zero Omega via cfe-commits

https://github.com/zeroomega review_requested 
https://github.com/llvm/llvm-project/pull/65823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits