1//
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
5
6
7// CONFIG rdar://6339747 but wasn't
8
9#include <stdio.h>
10
11int (*funcptr)(long);
12
13int (*(^b)(char))(long);
14
15int main(int argc, char *argv[]) {
16 // implicit is fine
17 b = ^(char x) { return funcptr; };
18 // explicit never parses
19 b = ^int (*(char x))(long) { return funcptr; };
20 printf(format: "%s: Success\n", argv[0]);
21 return 0;
22}
23

source code of compiler-rt/test/BlocksRuntime/returnfunctionptr.c