1 | class Baz { |
2 | public: |
3 | int Foo; /* Test 1 */ // CHECK: int Bar; |
4 | }; |
5 | |
6 | int qux(int x) { return 0; } |
7 | #define MACRO(a) qux(a) |
8 | |
9 | int main() { |
10 | Baz baz; |
11 | baz.Foo = 1; /* Test 2 */ // CHECK: baz.Bar = 1; |
12 | MACRO(baz.Foo); // CHECK: MACRO(baz.Bar); |
13 | int y = baz.Foo; // CHECK: int y = baz.Bar; |
14 | } |
15 | |
16 | // Test 1. |
17 | // RUN: clang-rename -offset=26 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s |
18 | // Test 2. |
19 | // RUN: clang-rename -offset=155 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s |
20 | |
21 | // To find offsets after modifying the file, use: |
22 | // grep -Ubo 'Foo.*' <file> |
23 | |