| 1 | #define Baz Foo // CHECK: #define Baz Bar |
| 2 | |
| 3 | void foo(int value) {} |
| 4 | |
| 5 | void macro() { |
| 6 | int Foo; /* Test 1 */ // CHECK: int Bar; |
| 7 | Foo = 42; /* Test 2 */ // CHECK: Bar = 42; |
| 8 | Baz -= 0; |
| 9 | foo(Foo); /* Test 3 */ // CHECK: foo(Bar); |
| 10 | foo(Baz); |
| 11 | } |
| 12 | |
| 13 | // Test 1. |
| 14 | // RUN: clang-rename -offset=88 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s |
| 15 | // Test 2. |
| 16 | // RUN: clang-rename -offset=129 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s |
| 17 | // Test 3. |
| 18 | // RUN: clang-rename -offset=191 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s |
| 19 | |
| 20 | // To find offsets after modifying the file, use: |
| 21 | // grep -Ubo 'Foo.*' <file> |
| 22 | |