aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/attributes-1.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/attributes-1.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/attributes-1.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/attributes-1.c b/gcc-4.9/gcc/testsuite/c-c++-common/attributes-1.c
new file mode 100644
index 000000000..af4dd1227
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/attributes-1.c
@@ -0,0 +1,23 @@
+/* { 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 g() __attribute__((aligned(bar))); /* { dg-error "invalid value|not an integer" } */
+
+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" } */