blob: abc25da1a3242e543e76dc7f3c3436ec11aebfae [file] [log] [blame]
Daniel Dunbard417d962008-09-03 21:17:21 +00001// RUN: clang -fsyntax-only -verify %s
2
3int a[10];
4
5int f0() {
6 return __builtin_object_size(&a); // expected-error {{too few arguments to function}}
7}
8int f1() {
9 return (__builtin_object_size(&a, 0) +
10 __builtin_object_size(&a, 1) +
11 __builtin_object_size(&a, 2) +
12 __builtin_object_size(&a, 3));
13}
14int f2() {
15 return __builtin_object_size(&a, -1); // expected-error {{argument should be a value from 0 to 3}}
16}
17int f3() {
18 return __builtin_object_size(&a, 4); // expected-error {{argument should be a value from 0 to 3}}
19}