blob: 4b15cb1f0e2344c968c5c2c6ded19f07baae1f2a [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify %s &&
2// RUN: clang-cc -fsyntax-only -triple x86_64-apple-darwin9 -verify %s
Daniel Dunbard417d962008-09-03 21:17:21 +00003
4int a[10];
5
6int f0() {
7 return __builtin_object_size(&a); // expected-error {{too few arguments to function}}
8}
9int f1() {
10 return (__builtin_object_size(&a, 0) +
11 __builtin_object_size(&a, 1) +
12 __builtin_object_size(&a, 2) +
13 __builtin_object_size(&a, 3));
14}
15int f2() {
16 return __builtin_object_size(&a, -1); // expected-error {{argument should be a value from 0 to 3}}
17}
18int f3() {
19 return __builtin_object_size(&a, 4); // expected-error {{argument should be a value from 0 to 3}}
20}
Chris Lattner891ed9a2008-09-28 06:05:35 +000021
22
23// rdar://6252231 - cannot call vsnprintf with va_list on x86_64
24void f4(const char *fmt, ...) {
25 __builtin_va_list args;
26 __builtin___vsnprintf_chk (0, 42, 0, 11, fmt, args);
27}
28