diff options
author | Gerolf Hoflehner <ghoflehner@apple.com> | 2014-08-18 23:03:30 +0000 |
---|---|---|
committer | Gerolf Hoflehner <ghoflehner@apple.com> | 2014-08-18 23:03:30 +0000 |
commit | 62bf7e83cbab97c04122f8228ac00274e9bc954f (patch) | |
tree | 7e0974b3d15398a7dabe9147a669fb41a9c7cf1f /clang-tools-extra/unittests/clang-rename/USRLocFindingTest.cpp | |
parent | f69cba649e8270a60663c66f0b0893b987990422 (diff) | |
download | bcm5719-llvm-62bf7e83cbab97c04122f8228ac00274e9bc954f.tar.gz bcm5719-llvm-62bf7e83cbab97c04122f8228ac00274e9bc954f.zip |
[clang-rename] revert r215839
The commit broke public build bots for more than 24 hours.
(view as text)
******************** TEST 'Clang Tools :: clang-rename/VarTest.cpp' FAILED ********************
Script:
--
cat /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp > /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp
clang-rename -offset=$(grep -FUbo 'foo;' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | head -1 | cut -d: -f1) -new-name=hector /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp -i --
sed 's,//.*,,' /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp | FileCheck /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang.src/tools/extra/test/clang-rename/VarTest.cpp
--
Exit Code: 1
Command Output (stderr):
--
clang-rename: could not find symbol at /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin11-nobootstrap-RAincremental/clang-build/tools/clang/tools/extra/test/clang-rename/Output/VarTest.cpp.tmp.cpp:2:1 (offset 14).
llvm-svn: 215947
Diffstat (limited to 'clang-tools-extra/unittests/clang-rename/USRLocFindingTest.cpp')
-rw-r--r-- | clang-tools-extra/unittests/clang-rename/USRLocFindingTest.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/clang-tools-extra/unittests/clang-rename/USRLocFindingTest.cpp b/clang-tools-extra/unittests/clang-rename/USRLocFindingTest.cpp deleted file mode 100644 index 4f497c6c928..00000000000 --- a/clang-tools-extra/unittests/clang-rename/USRLocFindingTest.cpp +++ /dev/null @@ -1,84 +0,0 @@ -#include "USRFindingAction.h" -#include "gtest/gtest.h" -#include "clang/Tooling/Tooling.h" -#include <stdio.h> -#include <set> -#include <map> -#include <vector> - -namespace clang { -namespace rename { -namespace test { - -// Determines if the symbol group invariants hold. To recap, those invariants -// are: -// (1) All symbols in the same symbol group share the same USR. -// (2) Two symbols from two different groups do not share the same USR. -static void testOffsetGroups(const char *Code, - const std::vector<std::vector<unsigned>> Groups) { - std::set<std::string> AllUSRs, CurrUSR; - - for (const auto &Group : Groups) { - // Groups the invariants do not hold then the value of USR is also invalid, - // but at that point the test has already failed and USR ceases to be - // useful. - std::string USR; - for (const auto &Offset : Group) { - USRFindingAction Action(Offset); - auto Factory = tooling::newFrontendActionFactory(&Action); - EXPECT_TRUE(tooling::runToolOnCode(Factory->create(), Code)); - const auto &USRs = Action.getUSRs(); - EXPECT_EQ(1u, USRs.size()); - USR = USRs[0]; - CurrUSR.insert(USR); - } - EXPECT_EQ(1u, CurrUSR.size()); - CurrUSR.clear(); - AllUSRs.insert(USR); - } - - EXPECT_EQ(Groups.size(), AllUSRs.size()); -} - - -TEST(USRLocFinding, FindsVarUSR) { - const char VarTest[] = "\n\ -namespace A {\n\ -int foo;\n\ -}\n\ -int foo;\n\ -int bar = foo;\n\ -int baz = A::foo;\n\ -void fun1() {\n\ - struct {\n\ - int foo;\n\ - } b = { 100 };\n\ - int foo = 100;\n\ - baz = foo;\n\ - {\n\ - extern int foo;\n\ - baz = foo;\n\ - foo = A::foo + baz;\n\ - A::foo = b.foo;\n\ - }\n\ - foo = b.foo;\n\ -}\n"; - std::vector<std::vector<unsigned>> VarTestOffsets(3); - VarTestOffsets[0].push_back(19); - VarTestOffsets[0].push_back(63); - VarTestOffsets[0].push_back(205); - VarTestOffsets[0].push_back(223); - VarTestOffsets[1].push_back(30); - VarTestOffsets[1].push_back(45); - VarTestOffsets[1].push_back(172); - VarTestOffsets[1].push_back(187); - VarTestOffsets[2].push_back(129); - VarTestOffsets[2].push_back(148); - VarTestOffsets[2].push_back(242); - - testOffsetGroups(VarTest, VarTestOffsets); -} - -} -} -} |