From c8d2b0ef4b94085d401640f70ea68ea9fe0fdea9 Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.oliveiramaroneze@cea.fr>
Date: Wed, 12 Dec 2018 10:52:14 +0100
Subject: [PATCH] [Tests] remove preprocessing line in oracle to avoid diffs

With older GCCs, or on macOS, pretty-printing the -m16, -m32 and -m64
flags may lead to oracles which are not reproducible.
---
 tests/libc/inttypes_h.c                   | 16 ++++++++--------
 tests/libc/oracle/inttypes_h.0.res.oracle |  2 --
 tests/libc/oracle/inttypes_h.1.res.oracle |  2 --
 tests/libc/oracle/inttypes_h.2.res.oracle |  2 --
 tests/libc/oracle/inttypes_h.3.res.oracle |  2 --
 tests/libc/oracle/inttypes_h.4.res.oracle |  2 --
 tests/libc/oracle/inttypes_h.5.res.oracle |  2 --
 tests/libc/oracle/inttypes_h.6.res.oracle |  2 --
 tests/libc/oracle/inttypes_h.7.res.oracle |  2 --
 9 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/tests/libc/inttypes_h.c b/tests/libc/inttypes_h.c
index 4fbe71cf8a2..646c8009c1f 100644
--- a/tests/libc/inttypes_h.c
+++ b/tests/libc/inttypes_h.c
@@ -1,12 +1,12 @@
 /* run.config
-OPT: -kernel-msg-key pp -machdep x86_16 -print
-OPT: -kernel-msg-key pp -machdep x86_32 -print
-OPT: -kernel-msg-key pp -machdep x86_64 -print
-OPT: -kernel-msg-key pp -machdep gcc_x86_16 -print
-OPT: -kernel-msg-key pp -machdep gcc_x86_32 -print
-OPT: -kernel-msg-key pp -machdep gcc_x86_64 -print
-OPT: -kernel-msg-key pp -machdep ppc_32 -print
-OPT: -kernel-msg-key pp -machdep msvc_x86_64 -print
+OPT: -machdep x86_16 -print
+OPT: -machdep x86_32 -print
+OPT: -machdep x86_64 -print
+OPT: -machdep gcc_x86_16 -print
+OPT: -machdep gcc_x86_32 -print
+OPT: -machdep gcc_x86_64 -print
+OPT: -machdep ppc_32 -print
+OPT: -machdep msvc_x86_64 -print
 */
 
 #include <inttypes.h>
diff --git a/tests/libc/oracle/inttypes_h.0.res.oracle b/tests/libc/oracle/inttypes_h.0.res.oracle
index cd58d651b71..eaaa132d690 100644
--- a/tests/libc/oracle/inttypes_h.0.res.oracle
+++ b/tests/libc/oracle/inttypes_h.0.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_16 -dD -nostdinc -m16 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
diff --git a/tests/libc/oracle/inttypes_h.1.res.oracle b/tests/libc/oracle/inttypes_h.1.res.oracle
index 9b6a585e15d..ee3b253caf3 100644
--- a/tests/libc/oracle/inttypes_h.1.res.oracle
+++ b/tests/libc/oracle/inttypes_h.1.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_32 -dD -nostdinc -m32 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
diff --git a/tests/libc/oracle/inttypes_h.2.res.oracle b/tests/libc/oracle/inttypes_h.2.res.oracle
index 3ddc4b43a71..a70f2266338 100644
--- a/tests/libc/oracle/inttypes_h.2.res.oracle
+++ b/tests/libc/oracle/inttypes_h.2.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_X86_64 -dD -nostdinc -m64 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
diff --git a/tests/libc/oracle/inttypes_h.3.res.oracle b/tests/libc/oracle/inttypes_h.3.res.oracle
index b6a1a81b1b5..eaaa132d690 100644
--- a/tests/libc/oracle/inttypes_h.3.res.oracle
+++ b/tests/libc/oracle/inttypes_h.3.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_GCC_X86_16 -dD -nostdinc -m16 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
diff --git a/tests/libc/oracle/inttypes_h.4.res.oracle b/tests/libc/oracle/inttypes_h.4.res.oracle
index 72f9ad7dc63..ee3b253caf3 100644
--- a/tests/libc/oracle/inttypes_h.4.res.oracle
+++ b/tests/libc/oracle/inttypes_h.4.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_GCC_X86_32 -dD -nostdinc -m32 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
diff --git a/tests/libc/oracle/inttypes_h.5.res.oracle b/tests/libc/oracle/inttypes_h.5.res.oracle
index 59a3cd9a2e1..a70f2266338 100644
--- a/tests/libc/oracle/inttypes_h.5.res.oracle
+++ b/tests/libc/oracle/inttypes_h.5.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_GCC_X86_64 -dD -nostdinc -m64 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
diff --git a/tests/libc/oracle/inttypes_h.6.res.oracle b/tests/libc/oracle/inttypes_h.6.res.oracle
index fb934c52cae..ee3b253caf3 100644
--- a/tests/libc/oracle/inttypes_h.6.res.oracle
+++ b/tests/libc/oracle/inttypes_h.6.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_PPC_32 -dD -nostdinc -m32 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
diff --git a/tests/libc/oracle/inttypes_h.7.res.oracle b/tests/libc/oracle/inttypes_h.7.res.oracle
index 0b9b61e5b78..6a5939c3673 100644
--- a/tests/libc/oracle/inttypes_h.7.res.oracle
+++ b/tests/libc/oracle/inttypes_h.7.res.oracle
@@ -1,5 +1,3 @@
-[kernel:pp] 
-  preprocessing with "gcc -E -C -I.  -I./share/libc -D__FRAMAC__ -D__FC_MACHDEP_MSVC_X86_64 -dD -nostdinc -m64 tests/libc/inttypes_h.c"
 [kernel] Parsing tests/libc/inttypes_h.c (with preprocessing)
 /* Generated by Frama-C */
 #include "errno.h"
-- 
GitLab