summaryrefslogtreecommitdiffstats
path: root/clang/test/Import
diff options
context:
space:
mode:
authorAleksei Sidorin <a.sidorin@samsung.com>2018-05-08 12:45:21 +0000
committerAleksei Sidorin <a.sidorin@samsung.com>2018-05-08 12:45:21 +0000
commit8f266dbbdcddb0fb9df96cb02b40550cdfdd5dd6 (patch)
tree0ba17c3384b1a2711d7ded5fb35243bd6887a3e6 /clang/test/Import
parent7562e34acc73d52a5ef2198fa013e4318dc344ce (diff)
downloadbcm5719-llvm-8f266dbbdcddb0fb9df96cb02b40550cdfdd5dd6.tar.gz
bcm5719-llvm-8f266dbbdcddb0fb9df96cb02b40550cdfdd5dd6.zip
[ASTImporter] Properly import SourceLocations of Attrs
Patch by Rafael Stahl! Differential Revision: https://reviews.llvm.org/D46115 llvm-svn: 331762
Diffstat (limited to 'clang/test/Import')
-rw-r--r--clang/test/Import/attr/Inputs/S.cpp13
-rw-r--r--clang/test/Import/attr/test.cpp26
2 files changed, 39 insertions, 0 deletions
diff --git a/clang/test/Import/attr/Inputs/S.cpp b/clang/test/Import/attr/Inputs/S.cpp
new file mode 100644
index 00000000000..28d70c544a7
--- /dev/null
+++ b/clang/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/clang/test/Import/attr/test.cpp b/clang/test/Import/attr/test.cpp
new file mode 100644
index 00000000000..01ea6c1b0ed
--- /dev/null
+++ b/clang/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;
+}
OpenPOWER on IntegriCloud