Skip to content

Commit f517b49

Browse files
committed
added test case for no fpfeatures
1 parent cb26d6a commit f517b49

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

clang/test/AST/ast-dump-fpfeatures.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,17 @@
88
// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
99
// RUN: | FileCheck --strict-whitespace %s
1010

11+
// CHECK-LABEL: FunctionDecl {{.*}} no_fpfeatures_func_01 'vector2float (vector2double)'
12+
// CHECK: CompoundStmt {{.*\>$}}
13+
// CHECK: ReturnStmt
14+
// CHECK: ConvertVectorExpr {{.*}} 'vector2float':'__attribute__((__vector_size__(2 * sizeof(float)))) float'{{$}}
15+
16+
typedef double vector2double __attribute__((__vector_size__(16)));
17+
typedef float vector2float __attribute__((__vector_size__(8)));
18+
vector2float no_fpfeatures_func_01(vector2double x) {
19+
return __builtin_convertvector(x, vector2float);
20+
}
21+
1122
float func_01(float x);
1223

1324
template <typename T>
@@ -255,8 +266,6 @@ float func_23(float x, float y) {
255266
// CHECK: ReturnStmt
256267
// CHECK: ConvertVectorExpr {{.*}} FPContractMode=2 ConstRoundingMode=towardzero
257268

258-
typedef double vector2double __attribute__((__vector_size__(16)));
259-
typedef float vector2float __attribute__((__vector_size__(8)));
260269
#pragma STDC FENV_ROUND FE_TOWARDZERO
261270
vector2float func_24(vector2double x) {
262271
return __builtin_convertvector(x, vector2float);

0 commit comments

Comments
 (0)