1
1
// RUN: %clang_cc1 -triple=aarch64-gnu-linux -emit-llvm -O1 %s -o - | FileCheck --check-prefix=NO-MATH-ERRNO %s
2
2
// RUN: %clang_cc1 -triple=aarch64-gnu-linux -emit-llvm -fmath-errno %s -o - | FileCheck --check-prefix=MATH-ERRNO %s
3
+ // RUN: %clang_cc1 -triple=aarch64-gnu-linux -emit-llvm -ffp-exception-behavior=strict %s -o - | FileCheck --check-prefix=STRICT-FP %s
3
4
4
5
void sincos (double , double * , double * );
5
6
void sincosf (float , float * , float * );
@@ -15,6 +16,9 @@ void sincosl(long double, long double*, long double*);
15
16
// MATH-ERRNO-LABEL: @sincos_f32
16
17
// MATH-ERRNO: call void @sincosf(
17
18
//
19
+ // STRICT-FP-LABEL: @sincos_f32
20
+ // STRICT-FP: call void @sincosf(
21
+ //
18
22
void sincos_f32 (float x , float * fp0 , float * fp1 ) {
19
23
sincosf (x , fp0 , fp1 );
20
24
}
@@ -43,6 +47,9 @@ void sincos_builtin_f32(float x, float* fp0, float* fp1) {
43
47
// MATH-ERRNO-LABEL: @sincos_f64
44
48
// MATH-ERRNO: call void @sincos(
45
49
//
50
+ // STRICT-FP-LABEL: @sincos_f64
51
+ // STRICT-FP: call void @sincos(
52
+ //
46
53
void sincos_f64 (double x , double * dp0 , double * dp1 ) {
47
54
sincos (x , dp0 , dp1 );
48
55
}
@@ -71,6 +78,9 @@ void sincos_builtin_f64(double x, double* dp0, double* dp1) {
71
78
// MATH-ERRNO-LABEL: @sincos_f128
72
79
// MATH-ERRNO: call void @sincosl(
73
80
//
81
+ // STRICT-FP-LABEL: @sincos_f128
82
+ // STRICT-FP: call void @sincosl(
83
+ //
74
84
void sincos_f128 (long double x , long double * ldp0 , long double * ldp1 ) {
75
85
sincosl (x , ldp0 , ldp1 );
76
86
}
@@ -88,3 +98,54 @@ void sincos_f128(long double x, long double* ldp0, long double* ldp1) {
88
98
void sincos_builtin_f128 (long double x , long double * ldp0 , long double * ldp1 ) {
89
99
__builtin_sincosl (x , ldp0 , ldp1 );
90
100
}
101
+
102
+ // NO-MATH-ERRNO-LABEL: @sincospi_f32
103
+ // NO-MATH-ERRNO: [[SINCOSPI:%.*]] = tail call { float, float } @llvm.sincospi.f32(float {{.*}})
104
+ // NO-MATH-ERRNO-NEXT: [[SINPI:%.*]] = extractvalue { float, float } [[SINCOSPI]], 0
105
+ // NO-MATH-ERRNO-NEXT: [[COSPI:%.*]] = extractvalue { float, float } [[SINCOSPI]], 1
106
+ // NO-MATH-ERRNO-NEXT: store float [[SINPI]], ptr {{.*}}, align 4, !alias.scope [[SINCOSPI_ALIAS_SCOPE:![0-9]+]]
107
+ // NO-MATH-ERRNO-NEXT: store float [[COSPI]], ptr {{.*}}, align 4, !noalias [[SINCOSPI_ALIAS_SCOPE]]
108
+ //
109
+ // MATH-ERRNO-LABEL: @sincospi_f32
110
+ // MATH-ERRNO: call void @sincospif(
111
+ //
112
+ // STRICT-FP-LABEL: @sincospi_f32
113
+ // STRICT-FP: call void @sincospif(
114
+ //
115
+ void sincospi_f32 (float x , float * fp0 , float * fp1 ) {
116
+ __builtin_sincospif (x , fp0 , fp1 );
117
+ }
118
+
119
+ // NO-MATH-ERRNO-LABEL: @sincospi_f64
120
+ // NO-MATH-ERRNO: [[SINCOSPI:%.*]] = tail call { double, double } @llvm.sincospi.f64(double {{.*}})
121
+ // NO-MATH-ERRNO-NEXT: [[SINPI:%.*]] = extractvalue { double, double } [[SINCOSPI]], 0
122
+ // NO-MATH-ERRNO-NEXT: [[COSPI:%.*]] = extractvalue { double, double } [[SINCOSPI]], 1
123
+ // NO-MATH-ERRNO-NEXT: store double [[SINPI]], ptr {{.*}}, align 8, !alias.scope [[SINCOSPI_ALIAS_SCOPE:![0-9]+]]
124
+ // NO-MATH-ERRNO-NEXT: store double [[COSPI]], ptr {{.*}}, align 8, !noalias [[SINCOSPI_ALIAS_SCOPE]]
125
+ //
126
+ // MATH-ERRNO-LABEL: @sincospi_f64
127
+ // MATH-ERRNO: call void @sincospi(
128
+ //
129
+ // STRICT-FP-LABEL: @sincospi_f64
130
+ // STRICT-FP: call void @sincospi(
131
+ //
132
+ void sincospi_f64 (double x , double * dp0 , double * dp1 ) {
133
+ __builtin_sincospi (x , dp0 , dp1 );
134
+ }
135
+
136
+ // NO-MATH-ERRNO-LABEL: @sincospi_f128
137
+ // NO-MATH-ERRNO: [[SINCOSPI:%.*]] = tail call { fp128, fp128 } @llvm.sincospi.f128(fp128 {{.*}})
138
+ // NO-MATH-ERRNO-NEXT: [[SINPI:%.*]] = extractvalue { fp128, fp128 } [[SINCOSPI]], 0
139
+ // NO-MATH-ERRNO-NEXT: [[COSPI:%.*]] = extractvalue { fp128, fp128 } [[SINCOSPI]], 1
140
+ // NO-MATH-ERRNO-NEXT: store fp128 [[SINPI]], ptr {{.*}}, align 16, !alias.scope [[SINCOSPI_ALIAS_SCOPE:![0-9]+]]
141
+ // NO-MATH-ERRNO-NEXT: store fp128 [[COSPI]], ptr {{.*}}, align 16, !noalias [[SINCOSPI_ALIAS_SCOPE]]
142
+ //
143
+ // MATH-ERRNO-LABEL: @sincospi_f128
144
+ // MATH-ERRNO: call void @sincospil(
145
+ //
146
+ // STRICT-FP-LABEL: @sincospi_f128
147
+ // STRICT-FP: call void @sincospil(
148
+ //
149
+ void sincospi_f128 (long double x , long double * ldp0 , long double * ldp1 ) {
150
+ __builtin_sincospil (x , ldp0 , ldp1 );
151
+ }
0 commit comments