Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | \
      2 // RUN:     FileCheck --check-prefix=WIN %s
      3 //
      4 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-mingw32 | \
      5 // RUN:     FileCheck --check-prefix=ITANIUM %s
      6 
      7 void __stdcall f1(void) {}
      8 // WIN: define x86_stdcallcc void @"\01?f1@@YGXXZ"
      9 // ITANIUM: define x86_stdcallcc void @"\01__Z2f1v@0"
     10 
     11 void __fastcall f2(void) {}
     12 // WIN: define x86_fastcallcc void @"\01?f2@@YIXXZ"
     13 // ITANIUM: define x86_fastcallcc void @"\01@_Z2f2v@0"
     14 
     15 extern "C" void __stdcall f3(void) {}
     16 // WIN: define x86_stdcallcc void @"\01_f3@0"
     17 // ITANIUM: define x86_stdcallcc void @"\01_f3@0"
     18 
     19 extern "C" void __fastcall f4(void) {}
     20 // WIN: define x86_fastcallcc void @"\01@f4@0"
     21 // ITANIUM: define x86_fastcallcc void @"\01@f4@0"
     22 
     23 struct Foo {
     24   void __stdcall foo();
     25   static void __stdcall bar();
     26 };
     27 
     28 void Foo::foo() {}
     29 // WIN: define x86_stdcallcc void @"\01?foo@Foo@@QAGXXZ"
     30 // ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3fooEv@4"
     31 
     32 void Foo::bar() {}
     33 // WIN: define x86_stdcallcc void @"\01?bar@Foo@@SGXXZ"
     34 // ITANIUM: define x86_stdcallcc void @"\01__ZN3Foo3barEv@0"
     35 
     36 // Mostly a test that we don't crash and that the names start with a \01.
     37 // gcc on mingw produces __Zpp@4
     38 // cl produces _++@4
     39 extern "C" void __stdcall operator++(Foo &x) {
     40 }
     41 // WIN: define x86_stdcallcc void @"\01??E@YGXAAUFoo@@@Z"
     42 // ITANIUM: define x86_stdcallcc void @"\01__ZppR3Foo@4"
     43