Daniel Dunbar | d417d96 | 2008-09-03 21:17:21 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | int a[10]; |
| 4 | |
| 5 | int f0() { |
| 6 | return __builtin_object_size(&a); // expected-error {{too few arguments to function}} |
| 7 | } |
| 8 | int 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 | } |
| 14 | int f2() { |
| 15 | return __builtin_object_size(&a, -1); // expected-error {{argument should be a value from 0 to 3}} |
| 16 | } |
| 17 | int f3() { |
| 18 | return __builtin_object_size(&a, 4); // expected-error {{argument should be a value from 0 to 3}} |
| 19 | } |