[cfe-commits] r121137 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDeclAttr.cpp test/CodeGen/2008-07-29-override-alias-decl.c test/CodeGen/pragma-weak.c test/CodeGenCXX/attr.cpp test/Sema/attr-alias.c test/SemaCXX/attr-weakref.cpp
Rafael Espindola
rafael.espindola at gmail.com
Tue Dec 7 07:23:24 PST 2010
Author: rafael
Date: Tue Dec 7 09:23:23 2010
New Revision: 121137
URL: http://llvm.org/viewvc/llvm-project?rev=121137&view=rev
Log:
Fix PR8720 by printing an error message with a substring that the gcc testsuite searches for.
Added:
cfe/trunk/test/Sema/attr-alias.c
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/test/CodeGen/2008-07-29-override-alias-decl.c
cfe/trunk/test/CodeGen/pragma-weak.c
cfe/trunk/test/CodeGenCXX/attr.cpp
cfe/trunk/test/SemaCXX/attr-weakref.cpp
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=121137&r1=121136&r2=121137&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Dec 7 09:23:23 2010
@@ -1001,6 +1001,8 @@
"weakref declaration of '%0' must be in a global context">;
def err_attribute_weakref_without_alias : Error<
"weakref declaration of '%0' must also have an alias attribute">;
+def err_alias_not_supported_on_darwin : Error <
+ "only weak aliases are supported on darwin">;
def warn_attribute_wrong_decl_type : Warning<
"%0 attribute only applies to %select{function|union|"
"variable and function|function or method|parameter|"
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=121137&r1=121136&r2=121137&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Tue Dec 7 09:23:23 2010
@@ -675,6 +675,11 @@
return;
}
+ if (S.Context.Target.getTriple().getOS() == llvm::Triple::Darwin) {
+ S.Diag(Attr.getLoc(), diag::err_alias_not_supported_on_darwin);
+ return;
+ }
+
// FIXME: check if target symbol exists in current file
d->addAttr(::new (S.Context) AliasAttr(Attr.getLoc(), S.Context,
Modified: cfe/trunk/test/CodeGen/2008-07-29-override-alias-decl.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/2008-07-29-override-alias-decl.c?rev=121137&r1=121136&r2=121137&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/2008-07-29-override-alias-decl.c (original)
+++ cfe/trunk/test/CodeGen/2008-07-29-override-alias-decl.c Tue Dec 7 09:23:23 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
int x() { return 1; }
Modified: cfe/trunk/test/CodeGen/pragma-weak.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/pragma-weak.c?rev=121137&r1=121136&r2=121137&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/pragma-weak.c (original)
+++ cfe/trunk/test/CodeGen/pragma-weak.c Tue Dec 7 09:23:23 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -emit-llvm %s -o - -verify | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm %s -o - -verify | FileCheck %s
// CHECK: @weakvar = weak global
// CHECK: @__weakvar_alias = common global
Modified: cfe/trunk/test/CodeGenCXX/attr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/attr.cpp?rev=121137&r1=121136&r2=121137&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/attr.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/attr.cpp Tue Dec 7 09:23:23 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-llvm -o - %s | FileCheck %s
// CHECK: @test2 = alias i32 ()* @_Z5test1v
Added: cfe/trunk/test/Sema/attr-alias.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-alias.c?rev=121137&view=auto
==============================================================================
--- cfe/trunk/test/Sema/attr-alias.c (added)
+++ cfe/trunk/test/Sema/attr-alias.c Tue Dec 7 09:23:23 2010
@@ -0,0 +1,8 @@
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify %s
+
+void g() {}
+
+// It is important that the following string be in the error message. The gcc
+// testsuite looks for it to decide if a target supports aliases.
+
+void f() __attribute__((alias("g"))); //expected-error {{only weak aliases are supported}}
Modified: cfe/trunk/test/SemaCXX/attr-weakref.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/attr-weakref.cpp?rev=121137&r1=121136&r2=121137&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/attr-weakref.cpp (original)
+++ cfe/trunk/test/SemaCXX/attr-weakref.cpp Tue Dec 7 09:23:23 2010
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -fsyntax-only -verify %s
// GCC will accept anything as the argument of weakref. Should we
// check for an existing decl?
More information about the cfe-commits
mailing list