diff options
author | Aleksei Sidorin <a.sidorin@samsung.com> | 2018-05-08 12:45:21 +0000 |
---|---|---|
committer | Aleksei Sidorin <a.sidorin@samsung.com> | 2018-05-08 12:45:21 +0000 |
commit | c03f8bb480be9ae467073e4c9ed3e60e313707f8 (patch) | |
tree | 8a33e3554335d402341a212b34918cce587d62d9 /test/Import | |
parent | 3c266eaebab0bb81d8d8fb2def71fc565431b190 (diff) | |
download | clang-c03f8bb480be9ae467073e4c9ed3e60e313707f8.tar.gz |
[ASTImporter] Properly import SourceLocations of Attrs
Patch by Rafael Stahl!
Differential Revision: https://reviews.llvm.org/D46115
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331762 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Import')
-rw-r--r-- | test/Import/attr/Inputs/S.cpp | 13 | ||||
-rw-r--r-- | test/Import/attr/test.cpp | 26 |
2 files changed, 39 insertions, 0 deletions
diff --git a/test/Import/attr/Inputs/S.cpp b/test/Import/attr/Inputs/S.cpp new file mode 100644 index 0000000000..28d70c544a --- /dev/null +++ b/test/Import/attr/Inputs/S.cpp @@ -0,0 +1,13 @@ +extern void f() __attribute__((const)); + +struct S { + struct { + int a __attribute__((packed)); + }; +}; + +void stmt() { +#pragma unroll + for (;;) + ; +} diff --git a/test/Import/attr/test.cpp b/test/Import/attr/test.cpp new file mode 100644 index 0000000000..01ea6c1b0e --- /dev/null +++ b/test/Import/attr/test.cpp @@ -0,0 +1,26 @@ +// RUN: clang-import-test -dump-ast -import %S/Inputs/S.cpp -expression %s | FileCheck %s +// CHECK: FunctionDecl +// CHECK-SAME: S.cpp:1:1, col:13 +// CHECK-NEXT: ConstAttr +// CHECK-SAME: col:32 + +// CHECK: IndirectFieldDecl +// CHECK-NEXT: Field +// CHECK-NEXT: Field +// CHECK-NEXT: PackedAttr +// CHECK-SAME: col:26 + +// CHECK: AttributedStmt +// CHECK-NEXT: LoopHintAttr +// CHECK-SAME: line:10:9 + +extern void f() __attribute__((const)); + +struct S; + +void stmt(); + +void expr() { + f(); + struct S s; +} |