summaryrefslogtreecommitdiffstats
path: root/test/ASTMerge/typedef/test.c
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2016-11-16 18:21:00 +0000
committerSean Callanan <scallanan@apple.com>2016-11-16 18:21:00 +0000
commit52fefd89fd4c7ce3d10b9df5ec0b1da5258fb33f (patch)
treed241145cd1d5c5f83af2e173cd241960576eab9e /test/ASTMerge/typedef/test.c
parent75468b182ef85c3e12160057b3ff8daf40cf4dee (diff)
Fixed layout of test/ASTMerge.
As outlined in a previous RFC, the test/ASTMerge/Inputs folder is getting full and the tests are starting to become interdependent. This is undesirable because - it makes it harder to write new tests - it makes it harder to figure out at a glance what old tests are doing, and - it adds the risk of breaking one test while changing a different one, because of the interdependencies. To fix this, according to the conversation in the RFC, I have changed the layout from a.c Inputs/a1.c Inputs/a2.c to a/test.c a/Inputs/a1.c a/Inputs/a2.c for all existing tests. I have also eliminated interdependencies by replicating the input files for each test that uses them. https://reviews.llvm.org/D26571 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@287129 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ASTMerge/typedef/test.c')
-rw-r--r--test/ASTMerge/typedef/test.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ASTMerge/typedef/test.c b/test/ASTMerge/typedef/test.c
new file mode 100644
index 0000000000..79e4723118
--- /dev/null
+++ b/test/ASTMerge/typedef/test.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: not %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: 1 error