Skip to content

[ADT] Add a unittest for the ScopedHashTable class #120183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

samolisov
Copy link
Contributor

The ScopedHashTable class is particularly used to develop string tables for parsers and code convertors. For example, the MLIRGen class from the toy example for MLIR actively uses this class to define scopes for declared variables. To demonstrate common use cases for the ScopedHashTable class as well as to check its behavior in different situations, the unittest has been added.

@llvmbot
Copy link
Member

llvmbot commented Dec 17, 2024

@llvm/pr-subscribers-llvm-adt

Author: Pavel Samolysov (samolisov)

Changes

The ScopedHashTable class is particularly used to develop string tables for parsers and code convertors. For example, the MLIRGen class from the toy example for MLIR actively uses this class to define scopes for declared variables. To demonstrate common use cases for the ScopedHashTable class as well as to check its behavior in different situations, the unittest has been added.


Full diff: https://github.com/llvm/llvm-project/pull/120183.diff

2 Files Affected:

  • (modified) llvm/unittests/ADT/CMakeLists.txt (+1)
  • (added) llvm/unittests/ADT/ScopedHashTableTest.cpp (+144)
diff --git a/llvm/unittests/ADT/CMakeLists.txt b/llvm/unittests/ADT/CMakeLists.txt
index 07568ad0c64e33..dafd73518aedb9 100644
--- a/llvm/unittests/ADT/CMakeLists.txt
+++ b/llvm/unittests/ADT/CMakeLists.txt
@@ -67,6 +67,7 @@ add_llvm_unittest(ADTTests
   SCCIteratorTest.cpp
   STLExtrasTest.cpp
   STLForwardCompatTest.cpp
+  ScopedHashTableTest.cpp
   ScopeExitTest.cpp
   SequenceTest.cpp
   SetOperationsTest.cpp
diff --git a/llvm/unittests/ADT/ScopedHashTableTest.cpp b/llvm/unittests/ADT/ScopedHashTableTest.cpp
new file mode 100644
index 00000000000000..e0dc1f453b3716
--- /dev/null
+++ b/llvm/unittests/ADT/ScopedHashTableTest.cpp
@@ -0,0 +1,144 @@
+//===- ScopedHashTableTest.cpp - ScopedHashTable unit tests ---------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/ScopedHashTable.h"
+#include "llvm/ADT/StringRef.h"
+#include "gtest/gtest.h"
+#include <memory>
+#include <stack>
+
+using ::llvm::ScopedHashTable;
+using ::llvm::ScopedHashTableScope;
+using ::llvm::StringRef;
+
+using ::testing::Test;
+
+class ScopedHashTableTest : public Test {
+protected:
+  ScopedHashTableTest() { symbolTable.insert(kGlobalName, kGlobalValue); }
+
+  ScopedHashTable<StringRef, StringRef> symbolTable{};
+  ScopedHashTableScope<StringRef, StringRef> globalScope{symbolTable};
+
+  static constexpr StringRef kGlobalName = "global";
+  static constexpr StringRef kGlobalValue = "gvalue";
+  static constexpr StringRef kLocalName = "local";
+  static constexpr StringRef kLocalValue = "lvalue";
+  static constexpr StringRef kLocalValue2 = "lvalue2";
+};
+
+TEST_F(ScopedHashTableTest, AccessWithNoActiveScope) {
+  EXPECT_EQ(symbolTable.count(kGlobalName), 1U);
+}
+
+TEST_F(ScopedHashTableTest, AccessWithAScope) {
+  [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+  EXPECT_EQ(symbolTable.count(kGlobalName), 1U);
+}
+
+TEST_F(ScopedHashTableTest, InsertInScope) {
+  [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+  symbolTable.insert(kLocalName, kLocalValue);
+  EXPECT_EQ(symbolTable.count(kLocalName), 1U);
+}
+
+TEST_F(ScopedHashTableTest, InsertInLinearSortedScope) {
+  [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+  [[maybe_unused]] ScopedHashTableScope varScope2(symbolTable);
+  [[maybe_unused]] ScopedHashTableScope varScope3(symbolTable);
+  symbolTable.insert(kLocalName, kLocalValue);
+  EXPECT_EQ(symbolTable.count(kLocalName), 1U);
+}
+
+TEST_F(ScopedHashTableTest, InsertInOutedScope) {
+  {
+    [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+    symbolTable.insert(kLocalName, kLocalValue);
+  }
+  EXPECT_EQ(symbolTable.count(kLocalName), 0U);
+}
+
+TEST_F(ScopedHashTableTest, OverrideInScope) {
+  [[maybe_unused]] ScopedHashTableScope funScope(symbolTable);
+  symbolTable.insert(kLocalName, kLocalValue);
+  {
+    [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
+    symbolTable.insert(kLocalName, kLocalValue2);
+    EXPECT_EQ(symbolTable.lookup(kLocalName), kLocalValue2);
+  }
+  EXPECT_EQ(symbolTable.lookup(kLocalName), kLocalValue);
+}
+
+TEST_F(ScopedHashTableTest, GetCurScope) {
+  EXPECT_EQ(symbolTable.getCurScope(), &globalScope);
+  {
+    ScopedHashTableScope funScope(symbolTable);
+    ScopedHashTableScope funScope2(symbolTable);
+    EXPECT_EQ(symbolTable.getCurScope(), &funScope2);
+    {
+      ScopedHashTableScope blockScope(symbolTable);
+      EXPECT_EQ(symbolTable.getCurScope(), &blockScope);
+    }
+    EXPECT_EQ(symbolTable.getCurScope(), &funScope2);
+  }
+  EXPECT_EQ(symbolTable.getCurScope(), &globalScope);
+}
+
+TEST_F(ScopedHashTableTest, PopScope) {
+  using SymbolTableScopeTy = ScopedHashTable<StringRef, StringRef>::ScopeTy;
+
+  std::stack<StringRef> ExpectedValues;
+  std::stack<std::unique_ptr<SymbolTableScopeTy>> Scopes;
+
+  Scopes.emplace(std::make_unique<SymbolTableScopeTy>(symbolTable));
+  ExpectedValues.emplace(kLocalValue);
+  symbolTable.insert(kGlobalName, kLocalValue);
+
+  Scopes.emplace(std::make_unique<SymbolTableScopeTy>(symbolTable));
+  ExpectedValues.emplace(kLocalValue2);
+  symbolTable.insert(kGlobalName, kLocalValue2);
+
+  while (symbolTable.getCurScope() != &globalScope) {
+    EXPECT_EQ(symbolTable.getCurScope(), Scopes.top().get());
+    EXPECT_EQ(symbolTable.lookup(kGlobalName), ExpectedValues.top());
+    ExpectedValues.pop();
+    Scopes.pop(); // destructs the SymbolTableScopeTy instance implicitly
+                  // calling Scopes.top()->~SymbolTableScopeTy();
+    EXPECT_NE(symbolTable.getCurScope(), nullptr);
+  }
+  ASSERT_TRUE(ExpectedValues.empty());
+  ASSERT_TRUE(Scopes.empty());
+  EXPECT_EQ(symbolTable.lookup(kGlobalName), kGlobalValue);
+}
+
+TEST_F(ScopedHashTableTest, DISABLED_PopScopeOnStack) {
+  using SymbolTableScopeTy = ScopedHashTable<StringRef, StringRef>::ScopeTy;
+  SymbolTableScopeTy funScope(symbolTable);
+  symbolTable.insert(kGlobalName, kLocalValue);
+  SymbolTableScopeTy funScope2(symbolTable);
+  symbolTable.insert(kGlobalName, kLocalValue2);
+
+  std::stack<StringRef> expectedValues{{kLocalValue, kLocalValue2}};
+  std::stack<SymbolTableScopeTy *> expectedScopes{{&funScope, &funScope2}};
+
+  while (symbolTable.getCurScope() != &globalScope) {
+    EXPECT_EQ(symbolTable.getCurScope(), expectedScopes.top());
+    expectedScopes.pop();
+    EXPECT_EQ(symbolTable.lookup(kGlobalName), expectedValues.top());
+    expectedValues.pop();
+    symbolTable.getCurScope()->~SymbolTableScopeTy();
+    EXPECT_NE(symbolTable.getCurScope(), nullptr);
+  }
+
+  // We have imbalanced scopes here:
+  // Assertion `HT.CurScope == this && "Scope imbalance!"' failed
+  // HT.CurScope is a pointer to the `globalScope` while
+  // `SymbolTableScopeTy.this` is still a pointer to `funScope2`.
+  // There is no way to write an assert on an assert in googletest so that we
+  // mark the test case as DISABLED.
+}

Copy link
Contributor

@kazutakahirata kazutakahirata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

The ScopedHashTable class is particularly used to develop string tables
for parsers and code convertors. For example, the MLIRGen class from the
toy example for MLIR actively uses this class to define scopes for
declared variables. To demonstrate common use cases for the
ScopedHashTable class as well as to check its behavior in different
situations, the unittest has been added.

Signed-off-by: Pavel Samolysov <samolisov@gmail.com>
@samolisov samolisov force-pushed the psamolysov/llvm/adt/unittest-for-scoped-hash-table branch from 187e6a8 to 32cf98f Compare December 18, 2024 03:34
@samolisov samolisov merged commit 1cc926b into llvm:main Dec 19, 2024
8 checks passed
@samolisov samolisov deleted the psamolysov/llvm/adt/unittest-for-scoped-hash-table branch December 19, 2024 03:36
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 19, 2024

LLVM Buildbot has detected a new failure on builder ppc64le-lld-multistage-test running on ppc64le-lld-multistage-test while building llvm at step 12 "build-stage2-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/168/builds/6753

Here is the relevant piece of the build log for the reference
Step 12 (build-stage2-unified-tree) failure: build (failure)
...
14.682 [1/8/15] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangASTPropertiesEmitter.cpp.o
15.436 [1/7/16] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangOptionDocEmitter.cpp.o
17.136 [1/6/17] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangOpenCLBuiltinEmitter.cpp.o
19.683 [1/5/18] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/RISCVVEmitter.cpp.o
19.966 [1/4/19] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangDiagnosticsEmitter.cpp.o
23.056 [1/3/20] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/MveEmitter.cpp.o
24.318 [1/2/21] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/NeonEmitter.cpp.o
39.251 [1/1/22] Building CXX object tools/clang/utils/TableGen/CMakeFiles/clang-tblgen.dir/ClangAttrEmitter.cpp.o
39.308 [0/1/23] Linking CXX executable bin/clang-tblgen
75.901 [5739/183/450] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o
FAILED: unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o 
ccache /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/install/stage1/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/unittests/ADT -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/build/stage2/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/third-party/unittest/googletest/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -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=c++17  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o -MF unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o.d -o unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:41:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   41 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:46:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   46 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:52:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   52 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:53:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   53 |   [[maybe_unused]] ScopedHashTableScope varScope2(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:54:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   54 |   [[maybe_unused]] ScopedHashTableScope varScope3(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:61:22: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   61 |     [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                      ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:68:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 19, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64le-rhel running on ppc64le-clang-rhel-test while building llvm at step 7 "test-build-unified-tree-check-all".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/145/builds/3933

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-all) failure: test (failure)
...
-- Configuring done (4.4s)
-- Generating done (0.2s)
-- Build files have been written to: /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/runtimes/runtimes-bins
21.455 [291/48/864] cd /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/clang/bindings/python && /home/buildbots/llvm-external-buildbots/cmake-3.28.2/bin/cmake -E env CLANG_NO_DEFAULT_CONFIG=1 CLANG_LIBRARY_PATH=/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/lib /home/buildbots/llvm-external-buildbots/workers/env/bin/python3.8 -m unittest discover
......................................................................................................................................................
----------------------------------------------------------------------
Ran 150 tests in 2.967s

OK
22.460 [115/48/1040] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o
FAILED: unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o 
ccache /home/docker/llvm-external-buildbots/clang.17.0.6/bin/clang++ --gcc-toolchain=/gcc-toolchain/usr -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/unittests/ADT -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/build/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/third-party/unittest/googletest/include -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -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=c++17  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o -MF unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o.d -o unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o -c /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:41:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   41 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:46:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   46 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:52:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   52 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:53:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   53 |   [[maybe_unused]] ScopedHashTableScope varScope2(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:54:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   54 |   [[maybe_unused]] ScopedHashTableScope varScope3(symbolTable);
      |                    ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:61:22: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   61 |     [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                      ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:68:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]

@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 22, 2024

LLVM Buildbot has detected a new failure on builder clang-ppc64-aix running on aix-ppc64 while building llvm at step 3 "clean-build-dir".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/64/builds/1749

Here is the relevant piece of the build log for the reference
Step 3 (clean-build-dir) failure: Delete failed. (failure) (timed out)
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
...
504.841 [655/50/334] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/ImmutableSetTest.cpp.o
504.985 [654/50/335] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/Interleave.cpp.o
505.135 [653/50/336] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/IntervalMapTest.cpp.o
505.266 [652/50/337] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/IntervalTreeTest.cpp.o
505.410 [651/50/338] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/IteratorTest.cpp.o
505.571 [650/50/339] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/LazyAtomicPointerTest.cpp.o
506.009 [649/50/340] Building CXX object tools/clang/unittests/Interpreter/CMakeFiles/ClangReplInterpreterTests.dir/IncrementalCompilerBuilderTest.cpp.o
506.106 [648/50/341] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/PackedVectorTest.cpp.o
506.279 [647/50/342] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/RewriteBufferTest.cpp.o
506.715 [646/50/343] Building CXX object unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o
FAILED: unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o 
/usr/local/clang-17.0.2/bin/clang++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_LARGE_FILE_API -D_XOPEN_SOURCE=700 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/unittests/ADT -I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT -I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/build/include -I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include -I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/third-party/unittest/googletest/include -I/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/third-party/unittest/googlemock/include -mcmodel=large -fPIC -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -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=c++17  -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -Wno-suggest-override -MD -MT unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o -MF unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o.d -o unittests/ADT/CMakeFiles/ADTTests.dir/ScopedHashTableTest.cpp.o -c /home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:41:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   41 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:46:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   46 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:52:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   52 |   [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                    ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:53:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   53 |   [[maybe_unused]] ScopedHashTableScope varScope2(symbolTable);
      |                    ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:54:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   54 |   [[maybe_unused]] ScopedHashTableScope varScope3(symbolTable);
      |                    ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:61:22: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
   61 |     [[maybe_unused]] ScopedHashTableScope varScope(symbolTable);
      |                      ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/include/llvm/ADT/ScopedHashTable.h:85:7: note: add a deduction guide to suppress this warning
   85 | class ScopedHashTableScope {
      |       ^
/home/powerllvm/powerllvm_env/aix-ppc64/clang-ppc64-aix/llvm-project/llvm/unittests/ADT/ScopedHashTableTest.cpp:68:20: error: 'ScopedHashTableScope' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants