[clang] fb9b3e9 - Update the status of some C11 and C99 features we support

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 20 11:50:48 PST 2023


Author: Aaron Ballman
Date: 2023-01-20T14:50:39-05:00
New Revision: fb9b3e9a5f23cfc43106c1209fd4a07761eee5e9

URL: https://github.com/llvm/llvm-project/commit/fb9b3e9a5f23cfc43106c1209fd4a07761eee5e9
DIFF: https://github.com/llvm/llvm-project/commit/fb9b3e9a5f23cfc43106c1209fd4a07761eee5e9.diff

LOG: Update the status of some C11 and C99 features we support

This updates the status of:

N505 Make qualifiers idempotent
N725 Integer promotion rules
N1311 Initializing static of external variables

Added: 
    clang/test/C/C11/n1311.c
    clang/test/C/C99/n505.c
    clang/test/C/C99/n725.c

Modified: 
    clang/www/c_status.html

Removed: 
    


################################################################################
diff  --git a/clang/test/C/C11/n1311.c b/clang/test/C/C11/n1311.c
new file mode 100644
index 0000000000000..8ceee74e43af6
--- /dev/null
+++ b/clang/test/C/C11/n1311.c
@@ -0,0 +1,19 @@
+// RUN: %clang_cc1 -emit-llvm -o - %s
+
+/* WG14 N1311: Yes
+ * Initializing static or external variables
+ */
+
+static int x;
+static union {
+  void *vp;
+  float f;
+  int i;
+} u;
+
+int main(void) {
+  return x + u.i;
+}
+
+// CHECK: @x ={{.*}}i32 0
+// CHECK-NEXT: @u ={{.*}}zeroinitializer

diff  --git a/clang/test/C/C99/n505.c b/clang/test/C/C99/n505.c
new file mode 100644
index 0000000000000..1163dd69a2e66
--- /dev/null
+++ b/clang/test/C/C99/n505.c
@@ -0,0 +1,9 @@
+// RUN: %clang_cc1 -verify %s
+
+/* WG14 N505: Yes
+ * Make qualifiers idempotent
+ */
+const const int i = 12; // expected-warning {{duplicate 'const' declaration specifier}}
+typedef const int cint;
+const cint j = 12;
+

diff  --git a/clang/test/C/C99/n725.c b/clang/test/C/C99/n725.c
new file mode 100644
index 0000000000000..f80ebc5603597
--- /dev/null
+++ b/clang/test/C/C99/n725.c
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -verify -triple i386-unknown-unknown %s
+// RUN: %clang_cc1 -verify -triple x86_64-unknown-unknown %s
+// expected-no-diagnostics
+
+/* WG14 N725: Yes
+ * Integer promotion rules
+ */
+_Static_assert((int)0x80000000U == -2147483648, "");
+_Static_assert((unsigned int)-1 == 0xFFFFFFFF, "");
+

diff  --git a/clang/www/c_status.html b/clang/www/c_status.html
index 7ed2f67acbcfd..741d8c5b1ad9c 100644
--- a/clang/www/c_status.html
+++ b/clang/www/c_status.html
@@ -270,7 +270,7 @@ <h2 id="c99">C99 implementation status</h2>
     <tr>
       <td>integer promotion rules</td>
       <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n725.htm">N725</a></td>
-      <td class="unknown" align="center">Unknown</td>
+      <td class="full" align="center">Yes</td>
     </tr>
     <tr>
       <td>macros with a variable number of arguments</td>
@@ -300,7 +300,7 @@ <h2 id="c99">C99 implementation status</h2>
     <tr>
       <td>idempotent type qualifiers</td>
       <td>N505</td>
-      <td class="unknown" align="center">Unknown</td>
+      <td class="full" align="center">Yes</td>
     </tr>
     <tr>
       <td>empty macro arguments</td>
@@ -416,7 +416,7 @@ <h2 id="c11">C11 implementation status</h2>
     <tr>
       <td>Initializing static or external variables</td>
       <td><a href="https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1311.pdf">N1311</a></td>
-      <td class="unknown" align="center">Unknown</td>
+      <td class="full" align="center">Yes</td>
     </tr>
     <tr>
       <td>Conversion between pointers and floating types</td>


        


More information about the cfe-commits mailing list