[cfe-commits] r82876 - in /cfe/trunk: include/clang/Basic/Builtins.def test/Sema/builtins.c
Chris Lattner
sabre at nondot.org
Sat Sep 26 14:16:01 PDT 2009
Author: lattner
Date: Sat Sep 26 16:16:00 2009
New Revision: 82876
URL: http://llvm.org/viewvc/llvm-project?rev=82876&view=rev
Log:
builtin_trap should be noreturn, this fixes PR5062, patch by
Roman Divacky!
Modified:
cfe/trunk/include/clang/Basic/Builtins.def
cfe/trunk/test/Sema/builtins.c
Modified: cfe/trunk/include/clang/Basic/Builtins.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=82876&r1=82875&r2=82876&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/Builtins.def (original)
+++ cfe/trunk/include/clang/Basic/Builtins.def Sat Sep 26 16:16:00 2009
@@ -271,7 +271,7 @@
BUILTIN(__builtin_expect, "iii" , "nc")
BUILTIN(__builtin_prefetch, "vvC*.", "nc")
-BUILTIN(__builtin_trap, "v", "n")
+BUILTIN(__builtin_trap, "v", "nr")
BUILTIN(__builtin_unreachable, "v", "nr")
BUILTIN(__builtin_shufflevector, "v." , "nc")
Modified: cfe/trunk/test/Sema/builtins.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/builtins.c?rev=82876&r1=82875&r2=82876&view=diff
==============================================================================
--- cfe/trunk/test/Sema/builtins.c (original)
+++ cfe/trunk/test/Sema/builtins.c Sat Sep 26 16:16:00 2009
@@ -62,3 +62,8 @@
__builtin_eh_return_data_regno(X); // expected-error {{not an integer constant expression}}
}
+// PR5062
+void test12(void) __attribute__((__noreturn__));
+void test12(void) {
+ __builtin_trap(); // no warning because trap is noreturn.
+}
More information about the cfe-commits
mailing list