diff options
author | Kirill Bobyrev <omtcyfz@gmail.com> | 2016-07-15 10:21:33 +0000 |
---|---|---|
committer | Kirill Bobyrev <omtcyfz@gmail.com> | 2016-07-15 10:21:33 +0000 |
commit | 713bdc01fb6d29f4698bacd4d18ec98c8b55b6cf (patch) | |
tree | ecbfbb535d64cc0a6016a4fb51e23bac408e886d /clang-tools-extra/test/clang-rename/FunctionMacro.cpp | |
parent | 4abe5d69ea2828b9afca49b47442515dea98211a (diff) | |
download | bcm5719-llvm-713bdc01fb6d29f4698bacd4d18ec98c8b55b6cf.tar.gz bcm5719-llvm-713bdc01fb6d29f4698bacd4d18ec98c8b55b6cf.zip |
[clang-rename] add few tests
Thiis patch introduces few additional tests including one case the tool does not handle yet, which should be fixed in the future.
Differential Revision: https://reviews.llvm.org/D22102
llvm-svn: 275545
Diffstat (limited to 'clang-tools-extra/test/clang-rename/FunctionMacro.cpp')
-rw-r--r-- | clang-tools-extra/test/clang-rename/FunctionMacro.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/clang-tools-extra/test/clang-rename/FunctionMacro.cpp b/clang-tools-extra/test/clang-rename/FunctionMacro.cpp new file mode 100644 index 00000000000..1cdac27ab3b --- /dev/null +++ b/clang-tools-extra/test/clang-rename/FunctionMacro.cpp @@ -0,0 +1,21 @@ +// RUN: cat %s > %t.cpp +// RUN: clang-rename -offset=199 -new-name=macro_function %t.cpp -i -- +// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s + +#define moo foo // CHECK: #define moo macro_function + +int foo() { // CHECK: int macro_function() { + return 42; +} + +void boo(int value) {} + +void qoo() { + foo(); // CHECK: macro_function(); + boo(foo()); // CHECK: boo(macro_function()); + moo(); + boo(moo()); +} + +// Use grep -FUbo 'foo;' <file> to get the correct offset of foo when changing +// this file. |