comparison gcc/testsuite/gcc.dg/torture/pr42363.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
44 i = j = bard (); 44 i = j = bard ();
45 45
46 return i + 1; 46 return i + 1;
47 } 47 }
48 48
49 /* This might be regarded as pure and folded, rather than inlined. 49 /* This might be regarded as pure and folded, rather than inlined,
50 It's pure evil. */ 50 but because it's pure evil it's diagnosed and the noreturn attribute
51 is dropped. The const attribute is dropped as well because it's
52 mutually exclusive with pure. */
51 static int __attribute__ ((pure, const, noreturn)) 53 static int __attribute__ ((pure, const, noreturn))
52 barf (void) 54 barf (void) {
53 { 55 /* { dg-warning "ignoring attribute .const." "const" { target *-*-* } .-1 } */
54 } /* { dg-warning "does return" } */ 56 /* { dg-warning "ignoring attribute .noreturn." "noreturn" { target *-*-* } .-2 } */
57
58 /* The noreturn attribute is ignored so verify there is no warning
59 for returning from the function:
60 { dg-bogus "does return" } */
61 }
55 62
56 static int __attribute__ ((pure, const)) 63 static int __attribute__ ((pure, const))
57 bark (void) 64 bark (void) { /* { dg-warning "ignoring attribute .const." } */
58 {
59 barf (); 65 barf ();
60 } 66 }
61 67
62 int buzr (void) 68 int buzr (void)
63 { 69 {