Home | History | Annotate | Download | only in CodeGenCXX
      1 // RUN: %clang_cc1 -emit-llvm %s -o - -triple=i386-pc-win32 | FileCheck %s
      2 
      3 void a1() {}
      4 // CHECK: "\01?a1@@YAXXZ"
      5 
      6 int a2() { return 0; }
      7 // CHECK: "\01?a2@@YAHXZ"
      8 
      9 const int a3() { return 0; }
     10 // CHECK: "\01?a3@@YA?BHXZ"
     11 
     12 volatile int a4() { return 0; }
     13 // CHECK: "\01?a4@@YA?CHXZ"
     14 
     15 const volatile int a5() { return 0; }
     16 // CHECK: "\01?a5@@YA?DHXZ"
     17 
     18 float a6() { return 0.0f; }
     19 // CHECK: "\01?a6@@YAMXZ"
     20 
     21 int *b1() { return 0; }
     22 // CHECK: "\01?b1@@YAPAHXZ"
     23 
     24 const char *b2() { return 0; }
     25 // CHECK: "\01?b2@@YAPBDXZ"
     26 
     27 float *b3() { return 0; }
     28 // CHECK: "\01?b3@@YAPAMXZ"
     29 
     30 const float *b4() { return 0; }
     31 // CHECK: "\01?b4@@YAPBMXZ"
     32 
     33 volatile float *b5() { return 0; }
     34 // CHECK: "\01?b5@@YAPCMXZ"
     35 
     36 const volatile float *b6() { return 0; }
     37 // CHECK: "\01?b6@@YAPDMXZ"
     38 
     39 float &b7() { return *(float*)0; }
     40 // CHECK: "\01?b7@@YAAAMXZ"
     41 
     42 const float &b8() { return *(float*)0; }
     43 // CHECK: "\01?b8@@YAABMXZ"
     44 
     45 volatile float &b9() { return *(float*)0; }
     46 // CHECK: "\01?b9@@YAACMXZ"
     47 
     48 const volatile float &b10() { return *(float*)0; }
     49 // CHECK: "\01?b10@@YAADMXZ"
     50 
     51 const char** b11() { return 0; }
     52 // CHECK: "\01?b11@@YAPAPBDXZ"
     53 
     54 class A {};
     55 
     56 A c1() { return A(); }
     57 // CHECK: "\01?c1@@YA?AVA@@XZ"
     58 
     59 const A c2() { return A(); }
     60 // CHECK: "\01?c2@@YA?BVA@@XZ"
     61 
     62 volatile A c3() { return A(); }
     63 // CHECK: "\01?c3@@YA?CVA@@XZ"
     64 
     65 const volatile A c4() { return A(); }
     66 // CHECK: "\01?c4@@YA?DVA@@XZ"
     67 
     68 const A* c5() { return 0; }
     69 // CHECK: "\01?c5@@YAPBVA@@XZ"
     70 
     71 volatile A* c6() { return 0; }
     72 // CHECK: "\01?c6@@YAPCVA@@XZ"
     73 
     74 const volatile A* c7() { return 0; }
     75 // CHECK: "\01?c7@@YAPDVA@@XZ"
     76 
     77 A &c8() { return *(A*)0; }
     78 // CHECK: "\01?c8@@YAAAVA@@XZ"
     79 
     80 const A &c9() { return *(A*)0; }
     81 // CHECK: "\01?c9@@YAABVA@@XZ"
     82 
     83 volatile A &c10() { return *(A*)0; }
     84 // CHECK: "\01?c10@@YAACVA@@XZ"
     85 
     86 const volatile A &c11() { return *(A*)0; }
     87 // CHECK: "\01?c11@@YAADVA@@XZ"
     88 
     89 template<typename T> class B {};
     90 
     91 B<int> d1() { return B<int>(); }
     92 // CHECK: "\01?d1@@YA?AV?$B@H@@XZ"
     93 
     94 B<const char*> d2() {return B<const char*>(); }
     95 // CHECK: "\01?d2@@YA?AV?$B@PBD@@XZ"
     96 
     97 B<A> d3() {return B<A>(); }
     98 // CHECK: "\01?d3@@YA?AV?$B@VA@@@@XZ"
     99 
    100 B<A>* d4() { return 0; }
    101 // CHECK: "\01?d4@@YAPAV?$B@VA@@@@XZ"
    102 
    103 const B<A>* d5() { return 0; }
    104 // CHECK: "\01?d5@@YAPBV?$B@VA@@@@XZ"
    105 
    106 volatile B<A>* d6() { return 0; }
    107 // CHECK: "\01?d6@@YAPCV?$B@VA@@@@XZ"
    108 
    109 const volatile B<A>* d7() { return 0; }
    110 // CHECK: "\01?d7@@YAPDV?$B@VA@@@@XZ"
    111 
    112 B<A>& d8() { return *(B<A>*)0; }
    113 // CHECK: "\01?d8@@YAAAV?$B@VA@@@@XZ"
    114 
    115 const B<A>& d9() { return *(B<A>*)0; }
    116 // CHECK: "\01?d9@@YAABV?$B@VA@@@@XZ"
    117 
    118 volatile B<A>& d10() { return *(B<A>*)0; }
    119 // CHECK: "\01?d10@@YAACV?$B@VA@@@@XZ"
    120 
    121 const volatile B<A>& d11() { return *(B<A>*)0; }
    122 // CHECK: "\01?d11@@YAADV?$B@VA@@@@XZ"
    123 
    124 enum Enum { DEFAULT };
    125 
    126 Enum e1() { return DEFAULT; }
    127 // CHECK: "\01?e1@@YA?AW4Enum@@XZ"
    128 
    129 const Enum e2() { return DEFAULT; }
    130 // CHECK: "\01?e2@@YA?BW4Enum@@XZ"
    131 
    132 Enum* e3() { return 0; }
    133 // CHECK: "\01?e3@@YAPAW4Enum@@XZ"
    134 
    135 Enum& e4() { return *(Enum*)0; }
    136 // CHECK: "\01?e4@@YAAAW4Enum@@XZ"
    137 
    138 struct S {};
    139 
    140 struct S f1() { struct S s; return s; }
    141 // CHECK: "\01?f1@@YA?AUS@@XZ"
    142 
    143 const struct S f2() { struct S s; return s; }
    144 // CHECK: "\01?f2@@YA?BUS@@XZ"
    145 
    146 struct S* f3() { return 0; }
    147 // CHECK: "\01?f3@@YAPAUS@@XZ"
    148 
    149 const struct S* f4() { return 0; }
    150 // CHECK: "\01?f4@@YAPBUS@@XZ"
    151 
    152 const volatile struct S* f5() { return 0; }
    153 // CHECK: "\01?f5@@YAPDUS@@XZ"
    154 
    155 struct S& f6() { return *(struct S*)0; }
    156 // CHECK: "\01?f6@@YAAAUS@@XZ"
    157 
    158 struct S* const f7() { return 0; }
    159 // CHECK: "\01?f7@@YAQAUS@@XZ"
    160 
    161 int S::* f8() { return 0; }
    162 // CHECK: "\01?f8@@YAPQS@@HXZ"
    163 
    164 int S::* const f9() { return 0; }
    165 // CHECK: "\01?f9@@YAQQS@@HXZ"
    166 
    167 int S::* __restrict f10() { return 0; }
    168 // CHECK: "\01?f10@@YAPIQS@@HXZ"
    169 
    170 int S::* const __restrict f11() { return 0; }
    171 // CHECK: "\01?f11@@YAQIQS@@HXZ"
    172 
    173 typedef int (*function_pointer)(int);
    174 
    175 function_pointer g1() { return 0; }
    176 // CHECK: "\01?g1@@YAP6AHH@ZXZ"
    177 
    178 const function_pointer g2() { return 0; }
    179 // CHECK: "\01?g2@@YAQ6AHH@ZXZ"
    180 
    181 function_pointer* g3() { return 0; }
    182 // CHECK: "\01?g3@@YAPAP6AHH@ZXZ"
    183 
    184 const function_pointer* g4() { return 0; }
    185 // CHECK: "\01?g4@@YAPBQ6AHH@ZXZ"
    186