diff --git a/tests/spec/const_fold_term.i b/tests/spec/const_fold_term.i
new file mode 100644
index 0000000000000000000000000000000000000000..c2f4bb8b69ca445cb6122eef5c8b69feda62c269
--- /dev/null
+++ b/tests/spec/const_fold_term.i
@@ -0,0 +1,22 @@
+/* run.config
+  MODULE: @PTEST_NAME@
+  STDOPT: -print
+*/
+
+void unop(int a) {
+  //@ assert -(21 + 21);
+  //@ assert ~21;
+  //@ assert -a;
+}
+
+void binop(int a) {
+  //@ assert 21 + 21 + a == 42;
+  //@ assert 84 - 42 == 42;
+  //@ assert 6 * 7 == 42;
+  //@ assert 21 << 1 == 42;
+  //@ assert 672 >> 4 == 42;
+  //@ assert (58 & 47) == 42;
+  //@ assert (34 | 8) == 42;
+  //@ assert (63 ^ 21) == 42;
+  //@ assert 168 / 4 == 42;
+}
diff --git a/tests/spec/const_fold_term.ml b/tests/spec/const_fold_term.ml
new file mode 100644
index 0000000000000000000000000000000000000000..4daf0015f496833e27acbdc4770eabd231c972b2
--- /dev/null
+++ b/tests/spec/const_fold_term.ml
@@ -0,0 +1,39 @@
+open Cil_types
+
+let fold t =
+  match t.term_node with
+  | TSizeOf _ | TSizeOfStr _ | TSizeOfE _ |  TAlignOf _ | TAlignOfE _
+  | TUnOp _ | TBinOp _ ->
+    let t' = Cil.constFoldTerm t in
+    Format.printf "  %a folds to %a@." Cil_printer.pp_term t Cil_printer.pp_term t'
+  | _ -> ()
+
+class visitTerm prj = object(_)
+  inherit Visitor.frama_c_copy prj
+
+  method! vterm t =
+    fold t;
+    Cil.DoChildren
+
+end
+
+let test_terms () =
+  let open Cil_builder.Exp in
+  let loc = Cil_datatype.Location.unknown in
+  let e1 = lognot ((of_int 21) + (of_int 21)) in
+  let e2 = lognot ((of_int 21) - (of_int 21)) in
+  let t1 = cil_term ~loc e1 in
+  let t2 = cil_term ~loc e2 in
+  Format.printf "Custom terms : @.";
+  fold t1;
+  fold t2
+
+let startup () =
+  test_terms ();
+  Format.printf "File terms : @.";
+  let prj = File.create_project_from_visitor "test_const_fold"
+      (fun prj -> new visitTerm prj)
+  in
+  Project.set_current prj
+
+let () = Boot.Main.extend startup
diff --git a/tests/spec/oracle/const_fold_term.res.oracle b/tests/spec/oracle/const_fold_term.res.oracle
new file mode 100644
index 0000000000000000000000000000000000000000..46762ef7b14e7c1d2c0bf6ae86cc147040e5cc34
--- /dev/null
+++ b/tests/spec/oracle/const_fold_term.res.oracle
@@ -0,0 +1,19 @@
+[kernel] Parsing const_fold_term.i (no preprocessing)
+Custom terms : 
+  !(21 + 21) folds to 1
+  !(21 - 21) folds to 0
+File terms : 
+  -(21 + 21) folds to -42
+  21 + 21 folds to 42
+  ~21 folds to -22
+  -a folds to -a
+  (21 + 21) + a folds to (21 + 21) + a
+  21 + 21 folds to 42
+  84 - 42 folds to 42
+  6 * 7 folds to 42
+  21 << 1 folds to 42
+  672 >> 4 folds to 42
+  58 & 47 folds to 42
+  34 | 8 folds to 42
+  63 ^ 21 folds to 42
+  168 / 4 folds to 168 / 4