]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Rewriter/dllimport-typedef.c
Vendor import of clang trunk r154661:
[FreeBSD/FreeBSD.git] / test / Rewriter / dllimport-typedef.c
1 // RUN: %clang_cc1 -triple i686-pc-win32 -fms-extensions -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-NEG %s
2 // RUN: %clang_cc1 -triple i686-pc-win32 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=CHECK-POS %s
3
4 // Do not report an error with including dllimport in the typedef when -fms-extensions is specified.
5 // Addresses <rdar://problem/7653870>.
6 typedef __declspec(dllimport) int CB(void);
7
8 // This function is added just to trigger a diagnostic.  This way we can test how many
9 // diagnostics we expect.
10 void bar() { return 1; }
11
12 // CHECK-NEG: error: void function 'bar' should not return a value
13 // CHECK-NEG: 1 error generated
14 // CHECK-POS: warning: 'dllimport' attribute only applies to variables and functions
15 // CHECK-POS: error: void function 'bar' should not return a value
16 // CHECK-POS: 1 warning and 1 error generated
17