From b01c416067006d7e98b7435602ef50d0da27215c Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.maroneze@cea.fr>
Date: Mon, 5 Feb 2024 08:28:50 +0100
Subject: [PATCH] add test case for new keywords

---
 tests/syntax/c11-keywords.c                   | 15 +++++++++++++++
 tests/syntax/oracle/c11-keywords.0.res.oracle |  2 +-
 tests/syntax/oracle/c11-keywords.1.res.oracle |  2 +-
 tests/syntax/oracle/c11-keywords.2.res.oracle |  2 +-
 tests/syntax/oracle/c11-keywords.3.res.oracle |  2 +-
 tests/syntax/oracle/c11-keywords.4.res.oracle |  4 ++++
 tests/syntax/oracle/c11-keywords.5.res.oracle |  4 ++++
 tests/syntax/oracle/c11-keywords.6.res.oracle |  4 ++++
 8 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 tests/syntax/oracle/c11-keywords.4.res.oracle
 create mode 100644 tests/syntax/oracle/c11-keywords.5.res.oracle
 create mode 100644 tests/syntax/oracle/c11-keywords.6.res.oracle

diff --git a/tests/syntax/c11-keywords.c b/tests/syntax/c11-keywords.c
index 53940ce6527..f679b6edd84 100644
--- a/tests/syntax/c11-keywords.c
+++ b/tests/syntax/c11-keywords.c
@@ -4,6 +4,9 @@
    STDOPT: #"-cpp-extra-args=-DALIGNOF"
    STDOPT: #"-cpp-extra-args=-DCOMPLEX"
    STDOPT: #"-cpp-extra-args=-DIMAGINARY"
+   STDOPT: #"-cpp-extra-args=-DDECIMAL"
+   STDOPT: #"-cpp-extra-args=-DINT128"
+   STDOPT: #"-cpp-extra-args=-DUINT128"
 */
 
 #ifdef ALIGNAS
@@ -26,5 +29,17 @@ int main(void) {
   double _Imaginary im = 0;
 #endif
 
+#ifdef DECIMAL
+  _Decimal32 d32 = 0.25;
+#endif
+
+#ifdef INT128
+  __int128 i128 = -1; // Not C11, but GNU extension
+#endif
+
+#ifdef UINT128
+  __uint128_t ui128 = 9; // Not C11, but GNU extension
+#endif
+
   return 0;
 }
diff --git a/tests/syntax/oracle/c11-keywords.0.res.oracle b/tests/syntax/oracle/c11-keywords.0.res.oracle
index b59e250637e..1cc5abcc5ea 100644
--- a/tests/syntax/oracle/c11-keywords.0.res.oracle
+++ b/tests/syntax/oracle/c11-keywords.0.res.oracle
@@ -1,4 +1,4 @@
 [kernel] Parsing c11-keywords.c (with preprocessing)
-[kernel] c11-keywords.c:11: User Error: 
+[kernel] c11-keywords.c:14: User Error: 
   _Alignas is currently unsupported by Frama-C.
 [kernel] Frama-C aborted: invalid user input.
diff --git a/tests/syntax/oracle/c11-keywords.1.res.oracle b/tests/syntax/oracle/c11-keywords.1.res.oracle
index 58485345dab..09119375ff8 100644
--- a/tests/syntax/oracle/c11-keywords.1.res.oracle
+++ b/tests/syntax/oracle/c11-keywords.1.res.oracle
@@ -1,4 +1,4 @@
 [kernel] Parsing c11-keywords.c (with preprocessing)
-[kernel] c11-keywords.c:17: User Error: 
+[kernel] c11-keywords.c:20: User Error: 
   _Alignof is currently unsupported by Frama-C.
 [kernel] Frama-C aborted: invalid user input.
diff --git a/tests/syntax/oracle/c11-keywords.2.res.oracle b/tests/syntax/oracle/c11-keywords.2.res.oracle
index afda7c511b5..f798466ad83 100644
--- a/tests/syntax/oracle/c11-keywords.2.res.oracle
+++ b/tests/syntax/oracle/c11-keywords.2.res.oracle
@@ -1,4 +1,4 @@
 [kernel] Parsing c11-keywords.c (with preprocessing)
-[kernel] c11-keywords.c:21: User Error: 
+[kernel] c11-keywords.c:24: User Error: 
   _Complex is currently unsupported by Frama-C.
 [kernel] Frama-C aborted: invalid user input.
diff --git a/tests/syntax/oracle/c11-keywords.3.res.oracle b/tests/syntax/oracle/c11-keywords.3.res.oracle
index abedc4ec18b..509cbfd869c 100644
--- a/tests/syntax/oracle/c11-keywords.3.res.oracle
+++ b/tests/syntax/oracle/c11-keywords.3.res.oracle
@@ -1,4 +1,4 @@
 [kernel] Parsing c11-keywords.c (with preprocessing)
-[kernel] c11-keywords.c:26: User Error: 
+[kernel] c11-keywords.c:29: User Error: 
   _Imaginary is currently unsupported by Frama-C.
 [kernel] Frama-C aborted: invalid user input.
diff --git a/tests/syntax/oracle/c11-keywords.4.res.oracle b/tests/syntax/oracle/c11-keywords.4.res.oracle
new file mode 100644
index 00000000000..46711a773da
--- /dev/null
+++ b/tests/syntax/oracle/c11-keywords.4.res.oracle
@@ -0,0 +1,4 @@
+[kernel] Parsing c11-keywords.c (with preprocessing)
+[kernel] c11-keywords.c:33: User Error: 
+  _Decimal32 is currently unsupported by Frama-C.
+[kernel] Frama-C aborted: invalid user input.
diff --git a/tests/syntax/oracle/c11-keywords.5.res.oracle b/tests/syntax/oracle/c11-keywords.5.res.oracle
new file mode 100644
index 00000000000..0ad4ce92a02
--- /dev/null
+++ b/tests/syntax/oracle/c11-keywords.5.res.oracle
@@ -0,0 +1,4 @@
+[kernel] Parsing c11-keywords.c (with preprocessing)
+[kernel] c11-keywords.c:37: User Error: 
+  __int128 is currently unsupported by Frama-C.
+[kernel] Frama-C aborted: invalid user input.
diff --git a/tests/syntax/oracle/c11-keywords.6.res.oracle b/tests/syntax/oracle/c11-keywords.6.res.oracle
new file mode 100644
index 00000000000..be870d4d203
--- /dev/null
+++ b/tests/syntax/oracle/c11-keywords.6.res.oracle
@@ -0,0 +1,4 @@
+[kernel] Parsing c11-keywords.c (with preprocessing)
+[kernel] c11-keywords.c:41: User Error: 
+  __uint128_t is currently unsupported by Frama-C.
+[kernel] Frama-C aborted: invalid user input.
-- 
GitLab