aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/ASTMerge/Inputs/typedef1.c4
-rw-r--r--test/ASTMerge/Inputs/typedef2.c4
-rw-r--r--test/ASTMerge/typedef.c7
-rw-r--r--test/ASTMerge/var.c1
4 files changed, 16 insertions, 0 deletions
diff --git a/test/ASTMerge/Inputs/typedef1.c b/test/ASTMerge/Inputs/typedef1.c
new file mode 100644
index 0000000000..5657675685
--- /dev/null
+++ b/test/ASTMerge/Inputs/typedef1.c
@@ -0,0 +1,4 @@
+typedef int Typedef1;
+typedef int Typedef2;
+Typedef1 x1;
+Typedef2 x2;
diff --git a/test/ASTMerge/Inputs/typedef2.c b/test/ASTMerge/Inputs/typedef2.c
new file mode 100644
index 0000000000..129d7101e9
--- /dev/null
+++ b/test/ASTMerge/Inputs/typedef2.c
@@ -0,0 +1,4 @@
+typedef int Typedef1;
+typedef double Typedef2;
+Typedef1 x1;
+Typedef2 x2;
diff --git a/test/ASTMerge/typedef.c b/test/ASTMerge/typedef.c
new file mode 100644
index 0000000000..4498864b49
--- /dev/null
+++ b/test/ASTMerge/typedef.c
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/typedef1.c
+// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/typedef2.c
+// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+
+// CHECK: typedef2.c:4:10: error: external variable 'x2' declared with incompatible types in different translation units ('Typedef2' (aka 'double') vs. 'Typedef2' (aka 'int'))
+// CHECK: typedef1.c:4:10: note: declared here with type 'Typedef2' (aka 'int')
+// CHECK: 2 diagnostics
diff --git a/test/ASTMerge/var.c b/test/ASTMerge/var.c
index 06bebd5ee8..fd307940af 100644
--- a/test/ASTMerge/var.c
+++ b/test/ASTMerge/var.c
@@ -9,3 +9,4 @@
// CHECK: var1.h:1:8: note: declared here with type 'double'
// CHECK: error: external variable 'xarray3' declared with incompatible types in different translation units ('int [17]' vs. 'int [18]')
// CHECK: var1.c:7:5: note: declared here with type 'int [18]'
+// CHECK: 6 diagnostics