summaryrefslogtreecommitdiffstats
path: root/clang/test/ASTMerge
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2017-04-03 09:30:20 +0000
committerGabor Horvath <xazax.hun@gmail.com>2017-04-03 09:30:20 +0000
commit5558ba2d82d7e6c0d30a3a3c1a3de790ca6abac3 (patch)
tree810815990001c80b5643ad2cea58b3cfc0977ef1 /clang/test/ASTMerge
parentbd96c73a1a060b23d231ce121d63ad0b3217ac56 (diff)
downloadbcm5719-llvm-5558ba2d82d7e6c0d30a3a3c1a3de790ca6abac3.tar.gz
bcm5719-llvm-5558ba2d82d7e6c0d30a3a3c1a3de790ca6abac3.zip
[ASTImporter] Lookup SearchName instead of Name
When the SearchName is already calculated we should use that for the lookup. Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D30877 llvm-svn: 299354
Diffstat (limited to 'clang/test/ASTMerge')
-rw-r--r--clang/test/ASTMerge/struct/Inputs/struct1.c16
-rw-r--r--clang/test/ASTMerge/struct/Inputs/struct2.c16
-rw-r--r--clang/test/ASTMerge/struct/test.c7
3 files changed, 38 insertions, 1 deletions
diff --git a/clang/test/ASTMerge/struct/Inputs/struct1.c b/clang/test/ASTMerge/struct/Inputs/struct1.c
index af2af8abc42..0f3e8b9bc3e 100644
--- a/clang/test/ASTMerge/struct/Inputs/struct1.c
+++ b/clang/test/ASTMerge/struct/Inputs/struct1.c
@@ -61,3 +61,19 @@ struct {
Int i;
float f;
} x11;
+
+// Matches
+typedef struct {
+ Int i;
+ float f;
+} S12;
+
+S12 x12;
+
+// Mismatch
+typedef struct {
+ Float i; // Mismatch here.
+ float f;
+} S13;
+
+S13 x13;
diff --git a/clang/test/ASTMerge/struct/Inputs/struct2.c b/clang/test/ASTMerge/struct/Inputs/struct2.c
index 4b43df71d8d..7fe17a576b2 100644
--- a/clang/test/ASTMerge/struct/Inputs/struct2.c
+++ b/clang/test/ASTMerge/struct/Inputs/struct2.c
@@ -58,3 +58,19 @@ struct {
int i;
float f;
} x11;
+
+// Matches
+typedef struct {
+ int i;
+ float f;
+} S12;
+
+S12 x12;
+
+// Mismatch
+typedef struct {
+ int i; // Mismatch here.
+ float f;
+} S13;
+
+S13 x13;
diff --git a/clang/test/ASTMerge/struct/test.c b/clang/test/ASTMerge/struct/test.c
index 4f41cea26b1..ed7750f6bec 100644
--- a/clang/test/ASTMerge/struct/test.c
+++ b/clang/test/ASTMerge/struct/test.c
@@ -39,4 +39,9 @@
// CHECK: struct2.c:53:43: note: field 'Deeper' has type 'struct DeeperError *' here
// CHECK: struct2.c:54:3: error: external variable 'xDeep' declared with incompatible types in different translation units ('struct DeepError' vs. 'struct DeepError')
// CHECK: struct1.c:57:3: note: declared here with type 'struct DeepError'
-// CHECK: 8 warnings and 7 errors generated
+// CHECK: struct1.c:74:9: warning: type 'S13' has incompatible definitions in different translation units
+// CHECK: struct1.c:75:9: note: field 'i' has type 'Float' (aka 'float') here
+// CHECK: struct2.c:72:7: note: field 'i' has type 'int' here
+// CHECK: struct2.c:76:5: error: external variable 'x13' declared with incompatible types in different translation units ('S13' vs. 'S13')
+// CHECK: struct1.c:79:5: note: declared here with type 'S13'
+// CHECK: 9 warnings and 8 errors generated
OpenPOWER on IntegriCloud