Skip to content

Commit 2bf25a8

Browse files
committed
add test for constant evaluation of vectors
1 parent f517b49 commit 2bf25a8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

clang/test/AST/const-fpfeatures.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ float _Complex C1u = C0;
2222
float FLu = 0.1F;
2323
// CHECK: @FLu = {{.*}} float 0x3FB99999A0000000
2424

25+
typedef float vector2float __attribute__((__vector_size__(8)));
26+
typedef double vector2double __attribute__((__vector_size__(16)));
27+
const vector2float V2Fu = {1.0F + 0x0.000001p0F, 1.0F + 0x0.000002p0F};
28+
vector2double V2Du = __builtin_convertvector(V2Fu, vector2double);
29+
// CHECK: @V2Fu = {{.*}} <2 x float> splat (float 0x3FF0000020000000)
30+
// CHECK: @V2Du = {{.*}} <2 x double> splat (double 0x3FF0000020000000)
2531

2632
#pragma STDC FENV_ROUND FE_DOWNWARD
2733

@@ -41,3 +47,8 @@ float _Complex C1d = C0;
4147

4248
float FLd = 0.1F;
4349
// CHECK: @FLd = {{.*}} float 0x3FB9999980000000
50+
51+
const vector2float V2Fd = {1.0F + 0x0.000001p0F, 1.0F + 0x0.000002p0F};
52+
vector2double V2Dd = __builtin_convertvector(V2Fd, vector2double);
53+
// CHECK: @V2Fd = {{.*}} <2 x float> <float 1.000000e+00, float 0x3FF0000020000000>
54+
// CHECK: @V2Dd = {{.*}} <2 x double> <double 1.000000e+00, double 0x3FF0000020000000>

0 commit comments

Comments
 (0)