2 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
3 // See https://llvm.org/LICENSE.txt for license information.
4 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 // -*- mode:C; c-basic-offset:4; tab-width:4; intent-tabs-mode:nil; -*-
7 // 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
16 int main (int argc
, const char * argv
[]) {
17 int (^sumn
)(int n
, ...);
20 sumn
= ^(int a
, int b
, int n
, ...){
26 for (i
= 0 ; i
< n
; i
++) {
27 result
+= va_arg(numbers
, int);
34 six
= sumn(3, 1, 2, 3);
37 printf("%s: Expected 6 but got %d\n", argv
[0], six
);
41 printf("%s: success\n", argv
[0]);