[cfe-commits] r95886 - in /cfe/trunk/test/ASTMerge: Inputs/struct1.c Inputs/struct2.c struct.c
Douglas Gregor
dgregor at apple.com
Thu Feb 11 10:18:11 PST 2010
Author: dgregor
Date: Thu Feb 11 12:18:11 2010
New Revision: 95886
URL: http://llvm.org/viewvc/llvm-project?rev=95886&view=rev
Log:
Add missing test cases for AST merging of structures.
Added:
cfe/trunk/test/ASTMerge/Inputs/struct1.c
cfe/trunk/test/ASTMerge/Inputs/struct2.c
cfe/trunk/test/ASTMerge/struct.c
Added: cfe/trunk/test/ASTMerge/Inputs/struct1.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ASTMerge/Inputs/struct1.c?rev=95886&view=auto
==============================================================================
--- cfe/trunk/test/ASTMerge/Inputs/struct1.c (added)
+++ cfe/trunk/test/ASTMerge/Inputs/struct1.c Thu Feb 11 12:18:11 2010
@@ -0,0 +1,16 @@
+typedef int Int;
+typedef float Float;
+
+struct S0 {
+ Int field1;
+ Float field2;
+};
+
+struct S0 x0;
+
+struct S1 {
+ Int field1;
+ int field2;
+};
+
+struct S1 x1;
Added: cfe/trunk/test/ASTMerge/Inputs/struct2.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ASTMerge/Inputs/struct2.c?rev=95886&view=auto
==============================================================================
--- cfe/trunk/test/ASTMerge/Inputs/struct2.c (added)
+++ cfe/trunk/test/ASTMerge/Inputs/struct2.c Thu Feb 11 12:18:11 2010
@@ -0,0 +1,13 @@
+struct S0 {
+ int field1;
+ float field2;
+};
+
+struct S0 x0;
+
+struct S1 {
+ int field1;
+ float field2;
+};
+
+struct S1 x1;
Added: cfe/trunk/test/ASTMerge/struct.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ASTMerge/struct.c?rev=95886&view=auto
==============================================================================
--- cfe/trunk/test/ASTMerge/struct.c (added)
+++ cfe/trunk/test/ASTMerge/struct.c Thu Feb 11 12:18:11 2010
@@ -0,0 +1,7 @@
+// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/struct1.c
+// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/struct2.c
+// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only %s 2>&1 | FileCheck %s
+
+// CHECK: struct2.c:13:11: error: external variable 'x1' declared with incompatible types in different translation units ('struct S1' vs. 'struct S1')
+// CHECK: struct1.c:16:11: note: declared here with type 'struct S1'
+// CHECK: 2 diagnostics
More information about the cfe-commits
mailing list