From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/ASTMerge/var.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 clang/test/ASTMerge/var.c (limited to 'clang/test/ASTMerge/var.c') diff --git a/clang/test/ASTMerge/var.c b/clang/test/ASTMerge/var.c new file mode 100644 index 0000000..e1dde6a --- /dev/null +++ b/clang/test/ASTMerge/var.c @@ -0,0 +1,12 @@ +// RUN: %clang_cc1 -emit-pch -o %t.1.ast %S/Inputs/var1.c +// RUN: %clang_cc1 -emit-pch -o %t.2.ast %S/Inputs/var2.c +// RUN: %clang_cc1 -ast-merge %t.1.ast -ast-merge %t.2.ast -fsyntax-only -fdiagnostics-show-note-include-stack %s 2>&1 | FileCheck %s + +// CHECK: var2.c:2:9: error: external variable 'x1' declared with incompatible types in different translation units ('double *' vs. 'float **') +// CHECK: var1.c:2:9: note: declared here with type 'float **' +// CHECK: var2.c:3:5: error: external variable 'x2' declared with incompatible types in different translation units ('int' vs. 'double') +// CHECK: In file included from{{.*}}var1.c:3: +// 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: 3 errors -- cgit v1.2.3