[cfe-commits] r77391 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/SemaDecl.cpp test/Sema/return-noreturn.c test/Sema/return.c

Benjamin Kramer benny.kra at googlemail.com
Tue Jul 28 17:13:55 PDT 2009


Mike Stump writes:
> ==============================================================================
> --- cfe/trunk/test/Sema/return-noreturn.c (added)
> +++ cfe/trunk/test/Sema/return-noreturn.c Tue Jul 28 18:11:12 2009
> @@ -0,0 +1,12 @@
> +// RUN: clang-cc %s -fsyntax-only -verify -Wmissing-noreturn
> +
> +int j;
> +void test1() { // expected-warning {{function could be attribute 'noreturn'}}
> +  ^ (void) { while (1) { } }(); // expected-warning {{block could be attribute 'noreturn'}}
> +  ^ (void) { if (j) while (1) { } }();
> +  while (1) { }
> +}
> +
> +void test2() {
> +  if (j) while (1) { }
> +}

Please add -fblocks to the RUN line. Blocks are enabled by default on darwin 10 only.

> Modified: cfe/trunk/test/Sema/return.c
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/return.c?rev=77391&r1=77390&r2=77391&view=diff
> 
> ==============================================================================
> --- cfe/trunk/test/Sema/return.c (original)
> +++ cfe/trunk/test/Sema/return.c Tue Jul 28 18:11:12 2009
> @@ -208,3 +208,13 @@
>  
>  typedef void test31_t(int status);
>  void test31(test31_t *callback __attribute__((noreturn)));
> +
> +void test32() {
> +  ^ (void) { while (1) { } }();
> +  ^ (void) { if (j) while (1) { } }();
> +  while (1) { }
> +}
> +
> +void test33() {
> +  if (j) while (1) { }
> +}

dito




More information about the cfe-commits mailing list