Skip to content

Commit 81921eb

Browse files
committed
[CodeGen] improve coverage for float (32-bit) type of NAN; NFC
Goes with D88238
1 parent bdc8529 commit 81921eb

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

clang/test/CodeGen/builtin-nan-exception.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,28 @@
55

66
// Run a variety of targets to ensure there's no target-based difference.
77

8-
// The builtin always produces a 64-bit (double).
98
// An SNaN with no payload is formed by setting the bit after the
109
// the quiet bit (MSB of the significand).
1110

1211
// CHECK: float 0x7FF8000000000000, float 0x7FF4000000000000
13-
// CHECK: double 0x7FF8000000000000, double 0x7FF4000000000000
1412

1513
float f[] = {
14+
__builtin_nanf(""),
15+
__builtin_nansf(""),
16+
};
17+
18+
19+
// Doubles are created and converted to floats.
20+
21+
// CHECK: float 0x7FF8000000000000, float 0x7FF4000000000000
22+
23+
float converted_to_float[] = {
1624
__builtin_nan(""),
1725
__builtin_nans(""),
1826
};
1927

28+
// CHECK: double 0x7FF8000000000000, double 0x7FF4000000000000
29+
2030
double d[] = {
2131
__builtin_nan(""),
2232
__builtin_nans(""),

0 commit comments

Comments
 (0)