File tree Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Expand file tree Collapse file tree 3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,11 @@ C2y Feature Support
293293 language modes but is now rejected (all of the other qualifiers and storage
294294 class specifiers were previously rejected).
295295
296+ - Updated conformance for `N3364 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3364.pdf >`_
297+ on floating-point translation-time initialization with signaling NaN. This
298+ paper adopts Clang's existing practice, so there were no changes to compiler
299+ behavior.
300+
296301C23 Feature Support
297302^^^^^^^^^^^^^^^^^^^
298303
Original file line number Diff line number Diff line change 1+ // RUN: %clang_cc1 -verify -std=c2y -Wall -pedantic -emit-llvm -o - %s
2+ // RUN: %clang_cc1 -verify -Wall -pedantic -emit-llvm -o - %s
3+ // expected-no-diagnostics
4+
5+ /* WG14 N3364: Yes
6+ * Give consistent wording for SNAN initialization v3
7+ *
8+ * Ensure that initializing from a signaling NAN (optionally with a unary + or
9+ * -) at translation time behaves correctly at runtime.
10+ */
11+
12+ #define FLT_SNAN __builtin_nansf("1")
13+ #define DBL_SNAN __builtin_nans("1")
14+ #define LD_SNAN __builtin_nansl("1")
15+
16+ float f1 = FLT_SNAN ;
17+ float f2 = + FLT_SNAN ;
18+ float f3 = - FLT_SNAN ;
19+ // CHECK: @f1 = {{.*}}global float 0x7FF0000020000000
20+ // CHECK: @f2 = {{.*}}global float 0x7FF0000020000000
21+ // CHECK: @f3 = {{.*}}global float 0xFFF0000020000000
22+
23+ double d1 = DBL_SNAN ;
24+ double d2 = + DBL_SNAN ;
25+ double d3 = - DBL_SNAN ;
26+ // CHECK: @d1 = {{.*}}global double 0x7FF0000000000001
27+ // CHECK: @d2 = {{.*}}global double 0x7FF0000000000001
28+ // CHECK: @d3 = {{.*}}global double 0xFFF0000000000001
29+
30+ long double ld1 = LD_SNAN ;
31+ long double ld2 = + LD_SNAN ;
32+ long double ld3 = - LD_SNAN ;
33+ // CHECK: @ld1 = {{.*}}global {{double 0x7FF0000000000001|x86_fp80 0xK7FFF8000000000000001|fp128 0xL00000000000000017FFF000000000000}}
34+ // CHECK: @ld2 = {{.*}}global {{double 0x7FF0000000000001|x86_fp80 0xK7FFF8000000000000001|fp128 0xL00000000000000017FFF000000000000}}
35+ // CHECK: @ld3 = {{.*}}global {{double 0xFFF0000000000001|x86_fp80 0xKFFFF8000000000000001|fp128 0xL0000000000000001FFFF000000000000}}
Original file line number Diff line number Diff line change @@ -231,7 +231,7 @@ <h2 id="c2y">C2y implementation status</h2>
231231 < tr >
232232 < td > Give consistent wording for SNAN initialization v3</ td >
233233 < td > < a href ="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3364.pdf "> N3364</ a > </ td >
234- < td class ="unknown " align ="center "> Unknown </ td >
234+ < td class ="full " align ="center "> Yes </ td >
235235 </ tr >
236236 < tr >
237237 < td > Case range expressions v3.1</ td >
You can’t perform that action at this time.
0 commit comments