1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240
|
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-C
// RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -target-feature +avx512fp16 -x c++ -std=c++11 < %s | FileCheck %s --check-prefixes=CHECK,CHECK-CPP
struct half1 {
_Float16 a;
};
struct half1 h1(_Float16 a) {
// CHECK: define{{.*}}half @
struct half1 x;
x.a = a;
return x;
}
struct half2 {
_Float16 a;
_Float16 b;
};
struct half2 h2(_Float16 a, _Float16 b) {
// CHECK: define{{.*}}<2 x half> @
struct half2 x;
x.a = a;
x.b = b;
return x;
}
struct half3 {
_Float16 a;
_Float16 b;
_Float16 c;
};
struct half3 h3(_Float16 a, _Float16 b, _Float16 c) {
// CHECK: define{{.*}}<4 x half> @
struct half3 x;
x.a = a;
x.b = b;
x.c = c;
return x;
}
struct half4 {
_Float16 a;
_Float16 b;
_Float16 c;
_Float16 d;
};
struct half4 h4(_Float16 a, _Float16 b, _Float16 c, _Float16 d) {
// CHECK: define{{.*}}<4 x half> @
struct half4 x;
x.a = a;
x.b = b;
x.c = c;
x.d = d;
return x;
}
struct floathalf {
float a;
_Float16 b;
};
struct floathalf fh(float a, _Float16 b) {
// CHECK: define{{.*}}<4 x half> @
struct floathalf x;
x.a = a;
x.b = b;
return x;
}
struct floathalf2 {
float a;
_Float16 b;
_Float16 c;
};
struct floathalf2 fh2(float a, _Float16 b, _Float16 c) {
// CHECK: define{{.*}}<4 x half> @
struct floathalf2 x;
x.a = a;
x.b = b;
x.c = c;
return x;
}
struct halffloat {
_Float16 a;
float b;
};
struct halffloat hf(_Float16 a, float b) {
// CHECK: define{{.*}}<4 x half> @
struct halffloat x;
x.a = a;
x.b = b;
return x;
}
struct half2float {
_Float16 a;
_Float16 b;
float c;
};
struct half2float h2f(_Float16 a, _Float16 b, float c) {
// CHECK: define{{.*}}<4 x half> @
struct half2float x;
x.a = a;
x.b = b;
x.c = c;
return x;
}
struct floathalf3 {
float a;
_Float16 b;
_Float16 c;
_Float16 d;
};
struct floathalf3 fh3(float a, _Float16 b, _Float16 c, _Float16 d) {
// CHECK: define{{.*}}{ <4 x half>, half } @
struct floathalf3 x;
x.a = a;
x.b = b;
x.c = c;
x.d = d;
return x;
}
struct half5 {
_Float16 a;
_Float16 b;
_Float16 c;
_Float16 d;
_Float16 e;
};
struct half5 h5(_Float16 a, _Float16 b, _Float16 c, _Float16 d, _Float16 e) {
// CHECK: define{{.*}}{ <4 x half>, half } @
struct half5 x;
x.a = a;
x.b = b;
x.c = c;
x.d = d;
x.e = e;
return x;
}
struct float2 {
struct {} s;
float a;
float b;
};
float pr51813(struct float2 s) {
// CHECK-C: define{{.*}} @pr51813(<2 x float>
// CHECK-CPP: define{{.*}} @_Z7pr518136float2(double {{.*}}, float
return s.a;
}
struct float3 {
float a;
struct {} s;
float b;
};
float pr51813_2(struct float3 s) {
// CHECK-C: define{{.*}} @pr51813_2(<2 x float>
// CHECK-CPP: define{{.*}} @_Z9pr51813_26float3(double {{.*}}, float
return s.a;
}
struct shalf2 {
struct {} s;
_Float16 a;
_Float16 b;
};
_Float16 sf2(struct shalf2 s) {
// CHECK-C: define{{.*}} @sf2(<2 x half>
// CHECK-CPP: define{{.*}} @_Z3sf26shalf2(double {{.*}}
return s.a;
};
struct halfs2 {
_Float16 a;
struct {} s1;
_Float16 b;
struct {} s2;
};
_Float16 fs2(struct shalf2 s) {
// CHECK-C: define{{.*}} @fs2(<2 x half>
// CHECK-CPP: define{{.*}} @_Z3fs26shalf2(double {{.*}}
return s.a;
};
struct fsd {
float a;
struct {};
double b;
};
struct fsd pr52011(void) {
// CHECK: define{{.*}} { float, double } @
}
struct hsd {
_Float16 a;
struct {};
double b;
};
struct hsd pr52011_2(void) {
// CHECK: define{{.*}} { half, double } @
}
struct hsf {
_Float16 a;
struct {};
float b;
};
struct hsf pr52011_3(void) {
// CHECK: define{{.*}} <4 x half> @
}
struct fds {
float a;
double b;
struct {};
};
struct fds pr52011_4(void) {
// CHECK-C: define{{.*}} { float, double } @pr52011_4
// CHECK-CPP: define{{.*}} void @_Z9pr52011_4v({{.*}} sret
}
|