2 // The LLVM Compiler Infrastructure
4 // This file is distributed under the University of Illinois Open Source
5 // License. See LICENSE.TXT for details.
7 // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*-
8 // HACK ALERT: gcc and g++ give different errors, referencing the line number to ensure that it checks for the right error; MUST KEEP IN SYNC WITH THE TEST
17 int main (int argc
, const char * argv
[]) {
18 int (^sumn
)(int n
, ...);
21 sumn
= ^(int a
, int b
, int n
, ...){
27 for (i
= 0 ; i
< n
; i
++) {
28 result
+= va_arg(numbers
, int);
35 six
= sumn(3, 1, 2, 3);
38 printf("%s: Expected 6 but got %d\n", argv
[0], six
);
42 printf("%s: success\n", argv
[0]);