view gcc/testsuite/c-c++-common/attributes-1.c @ 140:4e440907fcbf

copy CbC goto flang in cfgexpand remove some CbC unnecessary code
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Wed, 14 Nov 2018 00:24:45 +0900
parents 84e7813d76e9
children 1830386684a0
line wrap: on
line source

/* { dg-do compile } */
/* { dg-prune-output "undeclared here \\(not in a function\\)|\[^\n\r\]* was not declared in this scope" } */

void* my_calloc(unsigned, unsigned) __attribute__((alloc_size(1,bar))); /* { dg-warning "outside range" } */
void* my_realloc(void*, unsigned) __attribute__((alloc_size(bar))); /* { dg-warning "outside range" } */

typedef char vec __attribute__((vector_size(bar))); /* { dg-warning "ignored" } */

void f1(char*) __attribute__((nonnull(bar))); /* { dg-error "invalid operand" } */
void f2(char*) __attribute__((nonnull(1,bar))); /* { dg-error "invalid operand" } */

void foo(void);
void* my_calloc(unsigned, unsigned) __attribute__((alloc_size(1,foo))); /* { dg-warning "outside range" } */
void* my_realloc(void*, unsigned) __attribute__((alloc_size(foo))); /* { dg-warning "outside range" } */

typedef char vec __attribute__((vector_size(foo))); /* { dg-warning "ignored" } */

void f1(char*) __attribute__((nonnull(foo))); /* { dg-error "invalid operand" } */
void f2(char*) __attribute__((nonnull(1,foo))); /* { dg-error "invalid operand" } */

void g() __attribute__((aligned(foo))); /* { dg-error "invalid value|not an integer" } */