1// RUN: %clang_cc1 %s -fsyntax-only -verify -fborland-extensions
2
3// Borland extensions
4
5// 1. test  -fborland-extensions
6int dummy_function() { return 0; }
7
8// 2. test __pascal
9int _pascal f2();
10
11float __pascal gi2(int, int);
12template<typename T> T g2(T (__pascal * const )(int, int)) { return 0; }
13
14struct M {
15    int __pascal addP();
16    float __pascal subtractP();
17};
18template<typename T> int h2(T (__pascal M::* const )()) { return 0; }
19void m2() {
20    int i; float f;
21    i = f2();
22    f = gi2(2, i);
23    f = g2(gi2);
24    i = h2<int>(&M::addP);
25    f = h2(&M::subtractP);
26}
27
28// 3. test other calling conventions
29int _cdecl fa3();
30int _fastcall fc3();
31int _stdcall fd3();
32
33// 4. test __uuidof()
34typedef struct _GUID {
35     unsigned long  Data1;
36     unsigned short Data2;
37     unsigned short Data3;
38     unsigned char  Data4[ 8 ];
39} GUID;
40
41struct __declspec(uuid("{12345678-1234-1234-1234-123456789abc}")) Foo;
42struct Data {
43     GUID const* Guid;
44};
45
46void t4() {
47    unsigned long  data;
48
49    const GUID guid_inl = __uuidof(Foo);
50    Data ata1 = { &guid_inl};
51    data = ata1.Guid->Data1;
52}
53
54