1/* 2 * Copyright (c) 2010 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LLVM_LICENSE_HEADER@ 5 */ 6/* 7 * shorthandexpression.c 8 * testObjects 9 * 10 * Created by Blaine Garst on 9/16/08. 11 * Copyright 2008 Apple. All rights reserved. 12 * 13 */ 14 15// TEST_CONFIG RUN=0 16 17/* 18TEST_BUILD_OUTPUT 19.*shorthandexpression.c: In function '.*__foo_block_invoke_1.*': 20.*shorthandexpression.c:36: error: blocks require { } 21OR 22.*shorthandexpression.c:36:(38|57): error: expected expression 23OR 24.*shorthandexpression.c: In function 'void __foo_block_invoke_1\(void\*\)': 25.*shorthandexpression.c:36: error: expected `{' before 'printf' 26.*shorthandexpression.c: In function 'void foo\(\)': 27.*shorthandexpression.c:36: error: cannot convert 'void \(\^\)\(\)' to 'int \(\^\)\(\)' in initialization 28.*shorthandexpression.c:36: error: expected ',' or ';' before 'printf' 29END 30*/ 31 32#include <stdio.h> 33#include "test.h" 34 35void foo() { 36 int (^b)(void) __unused = ^(void)printf("hello world\n"); 37} 38 39int main() { 40 fail("this shouldn't compile\n"); 41} 42