[m-rev.] for review: Delete Erlang from tests.

Peter Wang novalazy at gmail.com
Mon Oct 26 17:09:23 AEDT 2020


tests/general/float_test.exp3:
tests/general/float_test.m:
tests/general/read_dir_regression.exp4:
tests/general/read_dir_regression.m:
tests/hard_coded/remove_file.exp2:
tests/hard_coded/remove_file.m:
    Delete Erlang backend specific expected outputs.

tests/hard_coded/Mmakefile:
tests/hard_coded/erlang_deconstruct.exp:
tests/hard_coded/erlang_deconstruct.m:
tests/hard_coded/existential_list.exp:
tests/hard_coded/existential_list.m:
tests/valid/Mmakefile:
tests/valid/erl_ite_vars.m:
tests/valid/zf_erlang_bug.m:
    Delete erlang target specific tests.

tests/*:
    Delete Erlang foreign procs and foreign types.

diff --git a/tests/general/float_test.exp3 b/tests/general/float_test.exp3
deleted file mode 100644
index a699f4b00..000000000
--- a/tests/general/float_test.exp3
+++ /dev/null
@@ -1,64 +0,0 @@
-1234.5678: 1.23e+03
-X:      3
-Y:      4
-X + Y:      7
-X * Y:     12
-X - Y:     -1
-X / Y:   0.75
-X ^ Y:     81
-
-X:     41
-Y:     -3
-X + Y:     38
-X * Y:   -123
-X - Y:     44
-X / Y:  -13.7
-X ^ Y: 1.45e-05
-
-Float max: 1.8e+308
-Float min: 2.23e-308
-Float epsilon: 2.22e-16
-
-Pi:   3.14
-e:   2.72
-
-X:      0
-ceiling(X):      0
-floor(X):      0
-round(X):      0
-truncate(X):      0
-
-X:    2.7
-ceiling(X):      3
-floor(X):      2
-round(X):      3
-truncate(X):      2
-
-X:   -3.6
-ceiling(X):     -3
-floor(X):     -4
-round(X):     -4
-truncate(X):     -3
-
-X:    2.2
-sqrt(X):   1.48
-ln(X):  0.788
-log2(X):   1.14
-log10(X):  0.342
-log(2.1, X):   1.06
-exp(X):   9.03
-
-X:    0.5
-sin(X):  0.479
-cos(X):  0.878
-tan(X):  0.546
-sinh(X):  0.521
-cosh(X):   1.13
-tanh(X):  0.462
-atan2(sin(X), cos(X)):    0.5
-
-X:    0.6
-asin(X):  0.644
-acos(X):  0.927
-atan(X):   0.54
-
diff --git a/tests/general/float_test.m b/tests/general/float_test.m
index e982d958c..4f6b563a2 100644
--- a/tests/general/float_test.m
+++ b/tests/general/float_test.m
@@ -7,7 +7,6 @@
 %
 % The .exp file is for grades that use double-precision floats.
 % The .exp2 file is for grades that use single-precision floats.
-% The .exp3 file is for the erlang grades (see below).
 %
 %---------------------------------------------------------------------------%
 
@@ -43,13 +42,8 @@ main(!IO) :-
     test_rounding(0.0, !IO),
     test_rounding(2.7, !IO),
     test_rounding(-3.6, !IO),
-    ( if have_erlang_grade then
-        true
-    else
-        % float.infinity is NYI for Erlang.
-        test_rounding(float.infinity, !IO),
-        test_rounding(-float.infinity, !IO)
-    ),
+    test_rounding(float.infinity, !IO),
+    test_rounding(-float.infinity, !IO),
     test_power(2.2, !IO),
     test_trig(0.5, !IO),
     test_inv_trig(0.6, !IO).
@@ -150,19 +144,5 @@ test_inv_trig(X, !IO) :-
     write_message("atan(X): ", math.atan(X), !IO),
     io.nl(!IO).
 
-%---------------------------------------------------------------------------%
-
-:- pred have_erlang_grade is semidet.
-
-:- pragma foreign_proc("Erlang",
-    have_erlang_grade,
-    [will_not_call_mercury, promise_pure, thread_safe],
-"
-    SUCCESS_INDICATOR = true
-").
-
-have_erlang_grade :-
-    semidet_false.
-
 %---------------------------------------------------------------------------%
 %---------------------------------------------------------------------------%
diff --git a/tests/general/read_dir_regression.exp4 b/tests/general/read_dir_regression.exp4
deleted file mode 100644
index 449307c68..000000000
--- a/tests/general/read_dir_regression.exp4
+++ /dev/null
@@ -1 +0,0 @@
-open failed: can't open input file: illegal operation on a directory
diff --git a/tests/general/read_dir_regression.m b/tests/general/read_dir_regression.m
index 65397cef0..8f8d1f20a 100644
--- a/tests/general/read_dir_regression.m
+++ b/tests/general/read_dir_regression.m
@@ -7,7 +7,6 @@
 % The .exp file is for the C grades (on Unix like systems).
 % The .exp2 file is for the Java grades.
 % The .exp3 file is for the C# grades.
-% The .exp4 file is for the Erlang grades.
 %
 %---------------------------------------------------------------------------%
 
diff --git a/tests/hard_coded/Mmakefile b/tests/hard_coded/Mmakefile
index b4ad0702c..abdf523f6 100644
--- a/tests/hard_coded/Mmakefile
+++ b/tests/hard_coded/Mmakefile
@@ -115,12 +115,10 @@ ORDINARY_PROGS = \
 	equality_pred_which_requires_boxing \
 	eqv_type_bug \
 	eqvclass_bug \
-	erlang_deconstruct \
 	erroneous_liveness \
 	error_func \
 	existential_bound_tvar \
 	existential_float \
-	existential_list \
 	existential_reordering \
 	existential_reordering_class \
 	existential_type_switch_opt \
diff --git a/tests/hard_coded/any_call_hoist_bug.m b/tests/hard_coded/any_call_hoist_bug.m
index 230cce418..c42ec3b9e 100644
--- a/tests/hard_coded/any_call_hoist_bug.m
+++ b/tests/hard_coded/any_call_hoist_bug.m
@@ -75,12 +75,6 @@ make_new_literal(NewLiteral) :-
 "
     B = A;
 ").
-:- pragma foreign_proc("Erlang",
-    cast_to_ground(A::ia) = (B::out),
-    [promise_pure, will_not_call_mercury],
-"
-    B = A
-").
 
 %---------------------------------------------------------------------------%
 %---------------------------------------------------------------------------%
diff --git a/tests/hard_coded/bitwise_int.m b/tests/hard_coded/bitwise_int.m
index f32bc2c4f..e0fdd2542 100644
--- a/tests/hard_coded/bitwise_int.m
+++ b/tests/hard_coded/bitwise_int.m
@@ -205,9 +205,6 @@ shift_amounts = [
         java.lang.Integer.toBinaryString(U)).replace(' ', '0');
 ").
 
-to_binary_string_lz(_) = _ :-
-    sorry($file, $pred, "to_binary_string_lz for Erlang backend").
-
 %---------------------------------------------------------------------------%
 :- end_module bitwise_int.
 %---------------------------------------------------------------------------%
diff --git a/tests/hard_coded/constraint_order.m b/tests/hard_coded/constraint_order.m
index a7f113566..cd229414d 100644
--- a/tests/hard_coded/constraint_order.m
+++ b/tests/hard_coded/constraint_order.m
@@ -55,8 +55,3 @@ test(3) :-
 "
     System.out.println(Str);
 ").
-:- pragma foreign_proc("Erlang", puts(Str::in), [],
-"
-    io:put_chars(Str),
-    io:nl()
-").
diff --git a/tests/hard_coded/copy_pred.m b/tests/hard_coded/copy_pred.m
index 938712d1e..2284aabc7 100644
--- a/tests/hard_coded/copy_pred.m
+++ b/tests/hard_coded/copy_pred.m
@@ -40,9 +40,6 @@ main(!IO) :-
 :- pragma foreign_proc("Java",
     inst_cast(X::in, Y::out(pred(in, out) is det)),
     [will_not_call_mercury, thread_safe, promise_pure], "Y = X;").
-:- pragma foreign_proc("Erlang",
-    inst_cast(X::in, Y::out(pred(in, out) is det)),
-    [will_not_call_mercury, thread_safe, promise_pure], "Y = X").
 
 :- pred foo(int::in, float::in, int::in, phloat::in, string::in, string::out)
     is det.
diff --git a/tests/hard_coded/copy_pred_2.m b/tests/hard_coded/copy_pred_2.m
index b34845ea6..ad57cfb03 100644
--- a/tests/hard_coded/copy_pred_2.m
+++ b/tests/hard_coded/copy_pred_2.m
@@ -43,9 +43,6 @@ make_closure(A, B, foo(A, B)).
 :- pragma foreign_proc("Java",
     inst_cast(X::in, Y::out(pred(in, out) is det)),
     [will_not_call_mercury, thread_safe, promise_pure], "Y = X;").
-:- pragma foreign_proc("Erlang",
-    inst_cast(X::in, Y::out(pred(in, out) is det)),
-    [will_not_call_mercury, thread_safe, promise_pure], "Y = X").
 
 :- pred foo(T, T, string, string).
 :- mode foo(in, in, in, out) is det.
diff --git a/tests/hard_coded/dupcall_impurity.m b/tests/hard_coded/dupcall_impurity.m
index 9c7970228..e2bdd8ba2 100644
--- a/tests/hard_coded/dupcall_impurity.m
+++ b/tests/hard_coded/dupcall_impurity.m
@@ -91,36 +91,3 @@ test2 -->
 "
         my_global++;
 ").
-
-:- pragma foreign_proc("Erlang",
-    get_x(X::out),
-    [will_not_call_mercury, promise_semipure],
-"
-    X = case get(my_global) of
-        undefined -> 0;
-        X0 -> X0
-        end
-").
-
-:- pragma foreign_proc("Erlang",
-    next_x(X::out),
-    [will_not_call_mercury],
-"
-    X = case get(my_global) of
-        undefined -> 0;
-        X0 -> X0
-        end,
-    put(my_global, X + 1),
-    X
-").
-
-:- pragma foreign_proc("Erlang",
-    incr_x,
-    [will_not_call_mercury],
-"
-    X = case get(my_global) of
-        undefined -> 0;
-        X0 -> X0
-        end,
-    put(my_global, X + 1)
-").
diff --git a/tests/hard_coded/equality_pred_which_requires_boxing.m b/tests/hard_coded/equality_pred_which_requires_boxing.m
index 320511121..273e96081 100644
--- a/tests/hard_coded/equality_pred_which_requires_boxing.m
+++ b/tests/hard_coded/equality_pred_which_requires_boxing.m
@@ -24,8 +24,6 @@
         "System.Double") where equality is unify_ft.
 :- pragma foreign_type(java, type_which_needs_boxing,
         "Double") where equality is unify_ft.
-:- pragma foreign_type(erlang, type_which_needs_boxing,
-        "") where equality is unify_ft.
 
 :- type type_which_needs_boxing(T).
 :- pragma foreign_type(c, type_which_needs_boxing(T), "double")
@@ -35,8 +33,6 @@
         where equality is unify_ft_T.
 :- pragma foreign_type(java, type_which_needs_boxing(T), "Double")
         where equality is unify_ft_T.
-:- pragma foreign_type(erlang, type_which_needs_boxing(T), "")
-        where equality is unify_ft_T.
 
 main(!IO) :-
     % Test a builtin type which requires boxing.
@@ -91,9 +87,6 @@ unify(S, X, Y, !IO) :-
 :- pragma foreign_proc("Java", create(X::in) = (Y::out), [promise_pure], "
     Y = X;
 ").
-:- pragma foreign_proc("Erlang", create(X::in) = (Y::out), [promise_pure], "
-    Y = X
-").
 
 :- func create_T(float) = type_which_needs_boxing(int).
 :- pragma foreign_proc("C", create_T(X::in) = (Y::out), [promise_pure], "
@@ -105,9 +98,6 @@ unify(S, X, Y, !IO) :-
 :- pragma foreign_proc("Java", create_T(X::in) = (Y::out), [promise_pure], "
     Y = X;
 ").
-:- pragma foreign_proc("Erlang", create_T(X::in) = (Y::out), [promise_pure], "
-    Y = X
-").
 
 :- pred unify_ft(type_which_needs_boxing::in, type_which_needs_boxing::in)
         is semidet.
@@ -120,9 +110,6 @@ unify(S, X, Y, !IO) :-
 :- pragma foreign_proc("Java", unify_ft(X::in, Y::in), [promise_pure], "
     SUCCESS_INDICATOR = X.equals(Y);
 ").
-:- pragma foreign_proc("Erlang", unify_ft(X::in, Y::in), [promise_pure], "
-    SUCCESS_INDICATOR = (X =:= Y)
-").
 
 :- pred unify_ft_T(type_which_needs_boxing(T)::in,
         type_which_needs_boxing(T)::in) is semidet.
@@ -135,9 +122,6 @@ unify(S, X, Y, !IO) :-
 :- pragma foreign_proc("Java", unify_ft_T(X::in, Y::in), [promise_pure], "
     SUCCESS_INDICATOR = X.equals(Y);
 ").
-:- pragma foreign_proc("Erlang", unify_ft_T(X::in, Y::in), [promise_pure], "
-    SUCCESS_INDICATOR = (X =:= Y)
-").
 
 :- pragma no_inline(float_a/0).
 :- func float_a = float.
diff --git a/tests/hard_coded/erlang_deconstruct.exp b/tests/hard_coded/erlang_deconstruct.exp
deleted file mode 100644
index 2bf3c9a00..000000000
--- a/tests/hard_coded/erlang_deconstruct.exp
+++ /dev/null
@@ -1,2 +0,0 @@
-f/1
-f/2
diff --git a/tests/hard_coded/erlang_deconstruct.m b/tests/hard_coded/erlang_deconstruct.m
deleted file mode 100644
index 0b63d71d6..000000000
--- a/tests/hard_coded/erlang_deconstruct.m
+++ /dev/null
@@ -1,41 +0,0 @@
-%---------------------------------------------------------------------------%
-% vim: ts=4 sw=4 et ft=mercury
-%---------------------------------------------------------------------------%
-%
-% Both alternatives of the type t are represented by tuples of size 3 on
-% the erlang backend, make sure the compiler distinguishes between
-% them correctly.
-
-:- module erlang_deconstruct.
-:- interface.
-:- import_module io.
-
-:- pred main(io::di, io::uo) is det.
-
-:- implementation.
-
-:- import_module int.
-
-:- type t
-    --->    f(int, int)
-    ;       some [T] f(T).
-
-main(!IO) :-
-    check_t(create(0), !IO),
-    check_t(create(100), !IO).
-
-:- pred check_t(t::in, io::di, io::uo) is det.
-
-check_t(f(_, _), !IO) :-
-    io.write_string("f/2\n", !IO).
-check_t(f(_), !IO) :-
-    io.write_string("f/1\n", !IO).
-
-:- func create(int) = t.
-
-create(N) =
-    ( abs(N) > 10 ->
-        f(1, 1)
-    ;
-        'new f'("string")
-    ).
diff --git a/tests/hard_coded/existential_list.exp b/tests/hard_coded/existential_list.exp
deleted file mode 100644
index 51622eea7..000000000
--- a/tests/hard_coded/existential_list.exp
+++ /dev/null
@@ -1 +0,0 @@
-[42, "bar"]
diff --git a/tests/hard_coded/existential_list.m b/tests/hard_coded/existential_list.m
deleted file mode 100644
index 1e822ad01..000000000
--- a/tests/hard_coded/existential_list.m
+++ /dev/null
@@ -1,25 +0,0 @@
-%---------------------------------------------------------------------------%
-% vim: ts=4 sw=4 et ft=mercury
-%---------------------------------------------------------------------------%
-%
-% The Erlang backend treats [] and [ | ] data constructors specially.
-% This test checks we can deconstruct existential types that use
-% the special syntax.
-
-:- module existential_list.
-:- interface.
-
-:- import_module io.
-
-:- pred main(io::di, io::uo) is det.
-
-:- implementation.
-
-:- type foo
-    --->    []
-    ;       some [T] [T | foo].
-
-main(!IO) :-
-    T = 'new [|]'(42, 'new [|]'("bar", [])) : foo,
-    io.write(T, !IO),
-    io.nl(!IO).
diff --git a/tests/hard_coded/export_test.m b/tests/hard_coded/export_test.m
index 66d5f5455..056eded79 100644
--- a/tests/hard_coded/export_test.m
+++ b/tests/hard_coded/export_test.m
@@ -46,7 +46,3 @@ foo(X, X+1).
         [may_call_mercury, promise_pure], "
     Y = export_test.foo(X);
 ").
-:- pragma foreign_proc("Erlang", bar(X::in, Y::out),
-        [may_call_mercury, promise_pure], "
-    Y = foo_2_p_0(X)
-").
diff --git a/tests/hard_coded/float_gv.m b/tests/hard_coded/float_gv.m
index 7c6023791..02ed333eb 100644
--- a/tests/hard_coded/float_gv.m
+++ b/tests/hard_coded/float_gv.m
@@ -22,7 +22,6 @@
 :- pragma foreign_type("C", coord, "coord *").
 :- pragma foreign_type("C#", coord, "Coord").
 :- pragma foreign_type("Java", coord, "Coord").
-:- pragma foreign_type("Erlang", coord, "").
 
 :- pragma foreign_decl(c, "
 typedef struct {
@@ -116,27 +115,6 @@ public static class Coord {
     Y = C.y;
 ").
 
-:- pragma foreign_proc("Erlang",
-    new_coord(X::in, Y::in) = (C::out),
-    [will_not_call_mercury, promise_pure],
-"
-    C = {X, Y}
-").
-
-:- pragma foreign_proc("Erlang",
-    x(C::in) = (X::out),
-    [will_not_call_mercury, promise_pure],
-"
-    {X, _} = C
-").
-
-:- pragma foreign_proc("Erlang",
-    y(C::in) = (Y::out),
-    [will_not_call_mercury, promise_pure],
-"
-    {_, Y} = C
-").
-
 :- mutable(gv1, float, 0.0, ground, [untrailed]).
 :- mutable(gv2, float, 2.3, ground, [untrailed]).
 :- mutable(gv3, string, "", ground, [untrailed]).
diff --git a/tests/hard_coded/foreign_import_module.m b/tests/hard_coded/foreign_import_module.m
index fae7ba00c..982876468 100644
--- a/tests/hard_coded/foreign_import_module.m
+++ b/tests/hard_coded/foreign_import_module.m
@@ -26,8 +26,6 @@ main(!IO) :-
 
 :- pragma foreign_import_module(c, foreign_import_module_2).
 :- pragma foreign_import_module(java, foreign_import_module_2).
-% not actually necessary in Erlang
-% :- pragma foreign_import_module(erlang, foreign_import_module_2).
 
 :- pragma foreign_proc("C",
     bar(X::in, Y::out),
@@ -56,12 +54,6 @@ main(!IO) :-
 "
     Y = foreign_import_module_2.foo(X);
 ").
-:- pragma foreign_proc("Erlang",
-    bar(X::in, Y::out),
-    [may_call_mercury, promise_pure],
-"
-    Y = foreign_import_module_2:foo(X)
-").
 
 :- pred bar2(int::in, int::out) is det.
 :- pragma foreign_proc("C",
@@ -91,9 +83,3 @@ main(!IO) :-
 "
     Y = foreign_import_module_2.foo(X);
 ").
-:- pragma foreign_proc("Erlang",
-    bar2(X::in, Y::out),
-    [may_call_mercury, promise_pure],
-"
-    Y = foreign_import_module_2:foo(X)
-").
diff --git a/tests/hard_coded/foreign_import_module_2.m b/tests/hard_coded/foreign_import_module_2.m
index fb719e23e..706bc0536 100644
--- a/tests/hard_coded/foreign_import_module_2.m
+++ b/tests/hard_coded/foreign_import_module_2.m
@@ -15,7 +15,6 @@
 :- pragma foreign_export("C", foo(in, out), "foo").
 :- pragma foreign_export("C#", foo(in, out), "foo").
 :- pragma foreign_export("Java", foo(in, out), "foo").
-:- pragma foreign_export("Erlang", foo(in, out), "foo").
 
 foo(X, X+1).
 
diff --git a/tests/hard_coded/foreign_type3.m b/tests/hard_coded/foreign_type3.m
index 69b8e92cd..50093a811 100644
--- a/tests/hard_coded/foreign_type3.m
+++ b/tests/hard_coded/foreign_type3.m
@@ -65,19 +65,16 @@ class coord {
 :- pragma foreign_type(c, dir, "dirs").
 :- pragma foreign_type("C#", dir, "dirs").
 :- pragma foreign_type(java, dir, "dirs").
-:- pragma foreign_type(erlang, dir, "").
 
 :- type coord.
 :- pragma foreign_type(c, coord, "coord").
 :- pragma foreign_type("C#", coord, "coord").
 :- pragma foreign_type(java, coord, "coord").
-:- pragma foreign_type(erlang, coord, "").
 
 :- type double.
 :- pragma foreign_type(c, double, "double").
 :- pragma foreign_type("C#", double, "double").
 :- pragma foreign_type(java, double, "Double").
-:- pragma foreign_type(erlang, double, "").
 
 :- func north = dir.
 :- pragma foreign_proc(c,
@@ -98,12 +95,6 @@ class coord {
 "
     E = dirs.north;
 ").
-:- pragma foreign_proc("Erlang",
-    north = (E::out),
-    [will_not_call_mercury, promise_pure],
-"
-    E = north
-").
 
 :- func new(int, int) = coord.
 :- pragma foreign_proc(c,
@@ -128,12 +119,6 @@ class coord {
     C.x = X;
     C.y = Y;
 ").
-:- pragma foreign_proc("Erlang",
-    new(X::in, Y::in) = (C::out),
-    [will_not_call_mercury, promise_pure],
-"
-    C = {X, Y}
-").
 
 :- func pi = double.
 :- pragma foreign_proc(c,
@@ -154,9 +139,3 @@ class coord {
 "
     Pi = 3.14;
 ").
-:- pragma foreign_proc("Erlang",
-    pi = (Pi::out),
-    [will_not_call_mercury, promise_pure],
-"
-    Pi = 3.14
-").
diff --git a/tests/hard_coded/ho_float_reg.m b/tests/hard_coded/ho_float_reg.m
index d1b6e2909..cd1b4c136 100644
--- a/tests/hard_coded/ho_float_reg.m
+++ b/tests/hard_coded/ho_float_reg.m
@@ -592,12 +592,6 @@ lost_inst(S0, S) :-
 "
     S = S0;
 ").
-:- pragma foreign_proc("Erlang",
-    cast_inst(S0::in, S::out(struct)),
-    [will_not_call_mercury, promise_pure, thread_safe],
-"
-    S = S0;
-").
 
 %---------------------------------------------------------------------------%
 
diff --git a/tests/hard_coded/ho_solns.m b/tests/hard_coded/ho_solns.m
index a9354e833..26b60dd49 100644
--- a/tests/hard_coded/ho_solns.m
+++ b/tests/hard_coded/ho_solns.m
@@ -62,11 +62,6 @@ main(!IO) :-
     L = L0;
 }
 ").
-:- pragma foreign_proc("Erlang",
-    convert_list(L0 :: in, L :: out(list_skel(mypred))),
-    [promise_pure], "
-    L = L0
-").
 
 :- pred use_list(list(mypred)::in(list_skel(mypred)), io::di, io::uo) is det.
 
diff --git a/tests/hard_coded/ho_univ_to_type.m b/tests/hard_coded/ho_univ_to_type.m
index 16ce88dc1..94c1f5ecc 100644
--- a/tests/hard_coded/ho_univ_to_type.m
+++ b/tests/hard_coded/ho_univ_to_type.m
@@ -83,8 +83,3 @@ foo(X) :-
     Pred2 = Pred1;
 }
 ").
-:- pragma foreign_proc("Erlang",
-    convert_inst(Pred1::in, Pred2::out(fpred)),
-    [will_not_call_mercury, promise_pure], "
-    Pred2 = Pred1
-").
diff --git a/tests/hard_coded/impure_foreign.m b/tests/hard_coded/impure_foreign.m
index daeae2eca..56324f32a 100644
--- a/tests/hard_coded/impure_foreign.m
+++ b/tests/hard_coded/impure_foreign.m
@@ -70,16 +70,6 @@ incr(_::out) :-
 "
     counter++; Val = counter;
 ").
-:- pragma foreign_proc("Erlang",
-    incr(Val::out),
-    [will_not_call_mercury],
-"
-    case get(counter) of
-        undefined -> Val = 2;
-        C -> Val = C + 1
-     end,
-     put(counter, Val)
-").
 
 :- semipure pred get(int::out) is det.
 
@@ -104,15 +94,6 @@ get(_::out) :-
 "
     Val = counter;
 ").
-:- pragma foreign_proc("Erlang",
-    get(Val::out),
-    [will_not_call_mercury, promise_semipure],
-"
-    Val = case get(counter) of
-        undefined -> 1;
-        C -> C
-    end
-").
 
 :- pred unsafe_get(int::out) is det.
 :- pragma promise_pure(unsafe_get/1).
diff --git a/tests/hard_coded/impure_init_and_final.m b/tests/hard_coded/impure_init_and_final.m
index 5445cf3c9..9aa7208eb 100644
--- a/tests/hard_coded/impure_init_and_final.m
+++ b/tests/hard_coded/impure_init_and_final.m
@@ -39,13 +39,6 @@ main(!IO) :-
 "
     System.out.println(S);
 ").
-:- pragma foreign_proc("Erlang",
-    puts(S::in),
-    [will_not_call_mercury],
-"
-    io:put_chars(S),
-    io:nl()
-").
 
 :- impure pred init is det.
 
diff --git a/tests/hard_coded/impure_prune.m b/tests/hard_coded/impure_prune.m
index 90be1262f..2cd810b9f 100644
--- a/tests/hard_coded/impure_prune.m
+++ b/tests/hard_coded/impure_prune.m
@@ -70,19 +70,3 @@ bump_counter :-
     X = counter;
 ").
 :- pragma foreign_proc("Java", set_counter(X::in), [], "counter = X;").
-
-:- pragma foreign_proc("Erlang",
-    get_counter(X::out),
-    [will_not_call_mercury, promise_semipure],
-"
-    X = case get(counter) of
-        undefined -> 0;
-        C -> C
-    end
-").
-:- pragma foreign_proc("Erlang",
-    set_counter(X::in),
-    [will_not_call_mercury],
-"
-    put(counter, X)
-").
diff --git a/tests/hard_coded/intermod_c_code2.m b/tests/hard_coded/intermod_c_code2.m
index a796d1148..1ec96fb16 100644
--- a/tests/hard_coded/intermod_c_code2.m
+++ b/tests/hard_coded/intermod_c_code2.m
@@ -36,10 +36,3 @@ c_code(T, U) :-
     U = T;
     TypeInfo_for_U = TypeInfo_for_T;
 }").
-:- pragma foreign_proc("Erlang",
-    c_code_2(T::in, U::out),
-    [promise_pure],
-"
-    U = T,
-    TypeInfo_for_U = TypeInfo_for_T
-").
diff --git a/tests/hard_coded/intermod_multimode.m b/tests/hard_coded/intermod_multimode.m
index 924a847e9..0e8f6339f 100644
--- a/tests/hard_coded/intermod_multimode.m
+++ b/tests/hard_coded/intermod_multimode.m
@@ -106,13 +106,6 @@ test2(0::out, 0::out) :-
 "
     System.out.println(S);
 ").
-:- pragma foreign_proc("Erlang",
-    puts(S::in),
-    [],
-"
-    io:put_chars(S),
-    io:nl()
-").
 
 :- pragma promise_pure(get_determinism/2).
 :- pragma inline(get_determinism/2).
diff --git a/tests/hard_coded/intermod_poly_mode_2.m b/tests/hard_coded/intermod_poly_mode_2.m
index a6878f02b..f67aa9ed1 100644
--- a/tests/hard_coded/intermod_poly_mode_2.m
+++ b/tests/hard_coded/intermod_poly_mode_2.m
@@ -28,9 +28,3 @@
 "
     R = X;
 ").
-:- pragma foreign_proc("Erlang",
-    new(X::in(I)) = (R::out(I)),
-    [promise_pure, will_not_call_mercury],
-"
-    R = X
-").
diff --git a/tests/hard_coded/loop_inv_test.m b/tests/hard_coded/loop_inv_test.m
index 6604217e8..8cd94bc25 100644
--- a/tests/hard_coded/loop_inv_test.m
+++ b/tests/hard_coded/loop_inv_test.m
@@ -107,20 +107,6 @@ loop2(N, Inv, Acc0, Acc) :-
 
     X = Inv + 42;
 ").
-:- pragma foreign_proc("Erlang",
-    p(Inv::in, X::out),
-    [will_not_call_mercury, promise_pure],
-"
-    % Test that p/1 only gets called once.
-    case get(p_called) of
-        undefined ->
-            put(p_called, true);
-        _ ->
-            throw(""p/1 called more than once"")
-    end,
-
-    X = Inv + 42
-").
 
 :- pred q(int::in, int::out) is det.
 :- pragma foreign_proc("C",
@@ -159,19 +145,5 @@ loop2(N, Inv, Acc0, Acc) :-
 
     X = Inv + 53;
 ").
-:- pragma foreign_proc("Erlang",
-    q(Inv::in, X::out),
-    [will_not_call_mercury, promise_pure],
-"
-    % Test that q/1 only gets called once.
-    case get(q_called) of
-        undefined ->
-            put(q_called, true);
-        _ ->
-            throw(""q/1 called more than once"")
-    end,
-
-    X = Inv + 53
-").
 
 %---------------------------------------------------------------------------%
diff --git a/tests/hard_coded/loop_inv_test1.m b/tests/hard_coded/loop_inv_test1.m
index caa6e7bbd..b0ec34c57 100644
--- a/tests/hard_coded/loop_inv_test1.m
+++ b/tests/hard_coded/loop_inv_test1.m
@@ -106,20 +106,6 @@ loop2(N, Acc0, Acc) :-
 
     X = 42;
 ").
-:- pragma foreign_proc("Erlang",
-    p(X::out),
-    [will_not_call_mercury, promise_pure],
-"
-    % Test that p/1 only gets called once.
-    case get(p_called) of
-        undefined ->
-            put(p_called, true);
-        _ ->
-            throw(""p/1 called more than once"")
-    end,
-
-    X = 42
-").
 
 :- pred q(int::out) is det.
 :- pragma foreign_proc("C",
@@ -158,19 +144,5 @@ loop2(N, Acc0, Acc) :-
 
     X = 53;
 ").
-:- pragma foreign_proc("Erlang",
-    q(X::out),
-    [will_not_call_mercury, promise_pure],
-"
-    % Test that q/1 only gets called once.
-    case get(q_called) of
-        undefined ->
-            put(q_called, true);
-        _ ->
-            throw(""q/1 called more than once"")
-    end,
-
-    X = 53
-").
 
 %---------------------------------------------------------------------------%
diff --git a/tests/hard_coded/lp.m b/tests/hard_coded/lp.m
index ead5a21ff..360961616 100644
--- a/tests/hard_coded/lp.m
+++ b/tests/hard_coded/lp.m
@@ -401,12 +401,6 @@ set_index(Tableau0, Rows0, Cols0, J, K, R, Tableau) :-
 "
     B = A;
 ").
-:- pragma foreign_proc("Erlang",
-    mkuniq(A::in, B::array_uo),
-    [will_not_call_mercury, promise_pure],
-"
-    B = A
-").
 
 %---------------------------------------------------------------------------%
 
diff --git a/tests/hard_coded/mode_choice.m b/tests/hard_coded/mode_choice.m
index afb6fbad0..c456d60ba 100644
--- a/tests/hard_coded/mode_choice.m
+++ b/tests/hard_coded/mode_choice.m
@@ -145,12 +145,6 @@ test2(_A::di, B::uo) :-
 "
     S = null;
 ").
-:- pragma foreign_proc("Erlang",
-    mkany(S::out(any)),
-    [promise_pure],
-"
-    S = null
-").
 
 % prefer in(any) over out(any)
 % [i.e. any -> any beats free -> any]
diff --git a/tests/hard_coded/multimode.m b/tests/hard_coded/multimode.m
index d522fd4ec..b798da69a 100644
--- a/tests/hard_coded/multimode.m
+++ b/tests/hard_coded/multimode.m
@@ -108,10 +108,3 @@ test2(0::out, 0::out) :-
 "
     System.out.println(S);
 ").
-:- pragma foreign_proc("Erlang",
-    puts(S::in),
-    [will_not_call_mercury],
-"
-    io:put_chars(S),
-    io:nl()
-").
diff --git a/tests/hard_coded/no_inline.m b/tests/hard_coded/no_inline.m
index e336e9418..2652a7306 100644
--- a/tests/hard_coded/no_inline.m
+++ b/tests/hard_coded/no_inline.m
@@ -58,16 +58,3 @@ main(!IO) :-
 "
     Value = counter++;
 ").
-
-:- pragma foreign_proc("Erlang",
-    bar(Value::out),
-    [],
-"
-    case get(counter) of
-    undefined ->
-        Value = 0;
-    C ->
-        Value = C
-    end,
-    put(counter, Value + 1)
-").
diff --git a/tests/hard_coded/pragma_foreign_export.m b/tests/hard_coded/pragma_foreign_export.m
index 789807421..b237e51c6 100644
--- a/tests/hard_coded/pragma_foreign_export.m
+++ b/tests/hard_coded/pragma_foreign_export.m
@@ -23,8 +23,6 @@ main(!IO) :-
     "exported_hello_world").
 :- pragma foreign_export("Java", hello_world(di, uo),
     "exported_hello_world").
-:- pragma foreign_export("Erlang", hello_world(di, uo),
-    "exported_hello_world").
 
 hello_world(!IO) :-
     io.write_string("Hello World!\n", !IO).
@@ -51,10 +49,3 @@ hello_world(!IO) :-
 "
     exported_hello_world();
 ").
-
-:- pragma foreign_proc("Erlang",
-    call_foreign(_IO0::di, _IO::uo),
-    [promise_pure, may_call_mercury],
-"
-    exported_hello_world()
-").
diff --git a/tests/hard_coded/redoip_clobber.m b/tests/hard_coded/redoip_clobber.m
index 320c228b5..530c16a8a 100644
--- a/tests/hard_coded/redoip_clobber.m
+++ b/tests/hard_coded/redoip_clobber.m
@@ -76,12 +76,6 @@ bar(X) :- X = 1.
 "
     SUCCESS_INDICATOR = false;
 ").
-:- pragma foreign_proc("Erlang",
-    use(_X::in),
-    [will_not_call_mercury, promise_pure],
-"
-    SUCCESS_INDICATOR = false
-").
 
 main(!IO) :-
     ( if foo(X), use(X) then
diff --git a/tests/hard_coded/remove_file.exp2 b/tests/hard_coded/remove_file.exp2
deleted file mode 100644
index ea4125a81..000000000
--- a/tests/hard_coded/remove_file.exp2
+++ /dev/null
@@ -1,2 +0,0 @@
-Test passed
-Second remove failed, as expected: remove failed: no such file or directory
diff --git a/tests/hard_coded/remove_file.m b/tests/hard_coded/remove_file.m
index 674b897ad..1e2e301bf 100644
--- a/tests/hard_coded/remove_file.m
+++ b/tests/hard_coded/remove_file.m
@@ -7,7 +7,6 @@
 % sensible or that a directory <drive letter>:\tmp exists.
 %
 % The .exp file is for the C backends.
-% The .exp2 file is for the Erlang backend.
 % The .exp3 file is for the Java backend.
 % The .exp4 file is for the C# backend.
 %
diff --git a/tests/hard_coded/rnd.m b/tests/hard_coded/rnd.m
index 17d7b535f..f5b3089c3 100644
--- a/tests/hard_coded/rnd.m
+++ b/tests/hard_coded/rnd.m
@@ -265,12 +265,6 @@ set(Vec0, Ind, V, Vec) :-
 "
     F = I;
 ").
-:- pragma foreign_proc("Erlang",
-    rfloat(I::in) = (F::out),
-    [promise_pure],
-"
-    F = float(I)
-").
 
 :- func rint(float) = int.
 :- pragma foreign_proc("C",
@@ -291,12 +285,6 @@ set(Vec0, Ind, V, Vec) :-
 "
     I = (int) F;"
 ).
-:- pragma foreign_proc("Erlang",
-    rint(F::in) = (I::out),
-    [promise_pure],
-"
-    I = trunc(F)"
-).
 
 :- pred for(int, int, pred(int, T, T), T, T).
 :- mode for(in, in, pred(in, in, out) is det, in, out) is det.
diff --git a/tests/hard_coded/trace_goal_4.m b/tests/hard_coded/trace_goal_4.m
index f122ff980..09f49044a 100644
--- a/tests/hard_coded/trace_goal_4.m
+++ b/tests/hard_coded/trace_goal_4.m
@@ -46,11 +46,3 @@ main(!IO) :-
 "
     System.out.println(""Progress reported "" + X);
 ").
-
-:- pragma foreign_proc("Erlang",
-    progress_report(X::in),
-    [will_not_call_mercury, thread_safe, tabled_for_io],
-"
-    io:format(""Progress reported ~p~n"", [X])
-").
-
diff --git a/tests/hard_coded/uint_bitwise.m b/tests/hard_coded/uint_bitwise.m
index 5051abb80..60c33dab8 100644
--- a/tests/hard_coded/uint_bitwise.m
+++ b/tests/hard_coded/uint_bitwise.m
@@ -201,9 +201,6 @@ shift_amounts = [
         java.lang.Integer.toBinaryString(U)).replace(' ', '0');
 ").
 
-to_binary_string_lz(_) = _ :-
-    sorry($file, $pred, "to_binary_string_lz for Erlang backend").
-
 %---------------------------------------------------------------------------%
 :- end_module uint_bitwise.
 %---------------------------------------------------------------------------%
diff --git a/tests/hard_coded/user_compare.m b/tests/hard_coded/user_compare.m
index 69195e0e3..ec697c99a 100644
--- a/tests/hard_coded/user_compare.m
+++ b/tests/hard_coded/user_compare.m
@@ -62,8 +62,6 @@ compare_foo(Res, Foo1, Foo2) :-
      equality is foreign_equals, comparison is foreign_compare.
 :- pragma foreign_type("Java", foreign, "Integer") where
      equality is foreign_equals, comparison is foreign_compare.
-:- pragma foreign_type(erlang, foreign, "") where
-     equality is foreign_equals, comparison is foreign_compare.
 
 :- pred foreign_equals(foreign::in, foreign::in) is semidet.
 :- pragma foreign_proc(c,
@@ -84,12 +82,6 @@ compare_foo(Res, Foo1, Foo2) :-
 "
     SUCCESS_INDICATOR = (Foreign1 == Foreign2);
 ").
-:- pragma foreign_proc("Erlang",
-    foreign_equals(Foreign1::in, Foreign2::in),
-    [will_not_call_mercury, promise_pure],
-"
-    SUCCESS_INDICATOR = (Foreign1 =:= Foreign2)
-").
 
 :- pred foreign_compare `with_type` compare(foreign) `with_inst` compare.
 
@@ -117,16 +109,6 @@ foreign_compare(Result, Foreign1, Foreign2) :-
 "
     Result = (Foreign1 < Foreign2 ? 1 : (Foreign1 == Foreign2 ? 0 : -1));
 ").
-:- pragma foreign_proc("Erlang",
-    foreign_compare_2(Result::out, Foreign1::in, Foreign2::in),
-    [will_not_call_mercury, promise_pure],
-"
-    Result = if
-    Foreign1 < Foreign2 -> 1;
-    Foreign1 =:= Foreign2 -> 0;
-    true -> -1
-end
-").
 
 :- func foreign(int) = foreign.
 :- pragma foreign_proc(c,
@@ -147,9 +129,3 @@ end
 "
     Foreign = Int;
 ").
-:- pragma foreign_proc("Erlang",
-    foreign(Int::in) = (Foreign::out),
-    [will_not_call_mercury, promise_pure],
-"
-    Foreign = Int
-").
diff --git a/tests/hard_coded/write_xml.m b/tests/hard_coded/write_xml.m
index 819dbe554..9aa063234 100644
--- a/tests/hard_coded/write_xml.m
+++ b/tests/hard_coded/write_xml.m
@@ -67,7 +67,6 @@
 :- pragma foreign_type("C", ftype, "int").
 :- pragma foreign_type("C#", ftype, "object").
 :- pragma foreign_type("Java", ftype, "Integer").
-:- pragma foreign_type("Erlang", ftype, "").
 
 :- pragma foreign_proc("C",
     make_ftype(F::out),
@@ -90,13 +89,6 @@
     F = 1;
 ").
 
-:- pragma foreign_proc("Erlang",
-    make_ftype(F::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
-"
-    F = 1
-").
-
 :- pred make_pointer(c_pointer::out) is det.
 
 :- pragma foreign_proc("C",
@@ -120,13 +112,6 @@
     P = null;
 ").
 
-:- pragma foreign_proc("Erlang",
-    make_pointer(P::out),
-    [will_not_call_mercury, thread_safe, promise_pure],
-"
-    P = null
-").
-
 :- pred p(int::in, int::in, mytype::in, int::out) is det.
 
 p(_, _, _, 1).
diff --git a/tests/invalid/bad_foreign_type.err_exp b/tests/invalid/bad_foreign_type.err_exp
index 1d8821bac..82393b2b5 100644
--- a/tests/invalid/bad_foreign_type.err_exp
+++ b/tests/invalid/bad_foreign_type.err_exp
@@ -61,25 +61,21 @@ bad_foreign_type.m:075: In the second argument of `:- pragma foreign_type'
 bad_foreign_type.m:075:   declaration:
 bad_foreign_type.m:075:   error: expected a type constructor and zero or more
 bad_foreign_type.m:075:   type variables as arguments, got `T'.
+bad_foreign_type.m:080: In the third argument of `:- pragma foreign_type'
+bad_foreign_type.m:080:   declaration:
+bad_foreign_type.m:080:   error: foreign type descriptor for language `C' must
+bad_foreign_type.m:080:   be a non-empty string.
 bad_foreign_type.m:081: In the third argument of `:- pragma foreign_type'
 bad_foreign_type.m:081:   declaration:
-bad_foreign_type.m:081:   error: foreign type descriptor for language `C' must
+bad_foreign_type.m:081:   error: foreign type descriptor for language `C#' must
 bad_foreign_type.m:081:   be a non-empty string.
 bad_foreign_type.m:082: In the third argument of `:- pragma foreign_type'
 bad_foreign_type.m:082:   declaration:
-bad_foreign_type.m:082:   error: foreign type descriptor for language `C#' must
-bad_foreign_type.m:082:   be a non-empty string.
-bad_foreign_type.m:083: In the third argument of `:- pragma foreign_type'
-bad_foreign_type.m:083:   declaration:
-bad_foreign_type.m:083:   error: foreign type descriptor for language `Java'
-bad_foreign_type.m:083:   must be a non-empty string.
-bad_foreign_type.m:084: In the third argument of `:- pragma foreign_type'
-bad_foreign_type.m:084:   declaration:
-bad_foreign_type.m:084:   error: foreign type descriptor for language `Erlang'
-bad_foreign_type.m:084:   must be an empty string.
-bad_foreign_type.m:089: In the fourth argument of `:- pragma foreign_type'
-bad_foreign_type.m:089:   declaration:
-bad_foreign_type.m:089:   error: foreign type assertion
-bad_foreign_type.m:089:   `can_pass_as_mercury_type' is repeated.
-bad_foreign_type.m:091: Warning: duplicate declaration for type `quux'/0.
-bad_foreign_type.m:080:   The previous declaration was here.
+bad_foreign_type.m:082:   error: foreign type descriptor for language `Java'
+bad_foreign_type.m:082:   must be a non-empty string.
+bad_foreign_type.m:087: In the fourth argument of `:- pragma foreign_type'
+bad_foreign_type.m:087:   declaration:
+bad_foreign_type.m:087:   error: foreign type assertion
+bad_foreign_type.m:087:   `can_pass_as_mercury_type' is repeated.
+bad_foreign_type.m:089: Warning: duplicate declaration for type `quux'/0.
+bad_foreign_type.m:079:   The previous declaration was here.
diff --git a/tests/invalid/bad_foreign_type.m b/tests/invalid/bad_foreign_type.m
index 92cecd245..9f169d4e9 100644
--- a/tests/invalid/bad_foreign_type.m
+++ b/tests/invalid/bad_foreign_type.m
@@ -75,13 +75,11 @@
 :- pragma foreign_type("C", T, "int").
 
     % Empty foreign type descriptor (C, C# , Java).
-    % Non-empty foreign type descriptor (Erlang).
     %
 :- type quux.
 :- pragma foreign_type("C", quux, "").
 :- pragma foreign_type("C#", quux, "").
 :- pragma foreign_type("Java", quux, "").
-:- pragma foreign_type("Erlang", quux, "abcde").
 
     % Repeated foreign type assertion.
     %
diff --git a/tests/invalid/bug476.err_exp b/tests/invalid/bug476.err_exp
index 9abca8647..8ae172b4b 100644
--- a/tests/invalid/bug476.err_exp
+++ b/tests/invalid/bug476.err_exp
@@ -1,6 +1,6 @@
-bug476.m:059: In instance declaration for `input_stream'/1:
-bug476.m:059:   the type class has no predicate method named `mark'/4.
-bug476.m:069: Error: pred `bug476.mark'/4 multiply defined.
+bug476.m:058: In instance declaration for `input_stream'/1:
+bug476.m:058:   the type class has no predicate method named `mark'/4.
+bug476.m:068: Error: pred `bug476.mark'/4 multiply defined.
 bug476.m:034: Here is the previous definition of pred `bug476.mark'/4.
-bug476.m:071: Error: clause for predicate `input_stream_mark'/3
-bug476.m:071:   without corresponding `:- pred' declaration.
+bug476.m:070: Error: clause for predicate `input_stream_mark'/3
+bug476.m:070:   without corresponding `:- pred' declaration.
diff --git a/tests/invalid/bug476.m b/tests/invalid/bug476.m
index 7dbd2a124..00a6326b0 100644
--- a/tests/invalid/bug476.m
+++ b/tests/invalid/bug476.m
@@ -51,7 +51,6 @@
 
 :- pragma foreign_type("C", jinput_stream, "void *").
 :- pragma foreign_type("C#", jinput_stream, "object").
-:- pragma foreign_type("Erlang", jinput_stream, "").
 :- pragma foreign_type("Java", jinput_stream, "java.io.InputStream").
 
 %---------------------------------------------------------------------------%
diff --git a/tests/invalid/foreign_include_file_missing.m b/tests/invalid/foreign_include_file_missing.m
index f03011eae..cae1147d1 100644
--- a/tests/invalid/foreign_include_file_missing.m
+++ b/tests/invalid/foreign_include_file_missing.m
@@ -14,6 +14,5 @@
 :- pragma foreign_code("C", include_file("missing_file")).
 :- pragma foreign_code("Java", include_file("missing_file")).
 :- pragma foreign_code("C#", include_file("missing_file")).
-:- pragma foreign_code("Erlang", include_file("missing_file")).
 
 main(!IO).
diff --git a/tests/invalid_purity/pragma_c_and_mercury.m b/tests/invalid_purity/pragma_c_and_mercury.m
index 453df16f7..b53d00de2 100644
--- a/tests/invalid_purity/pragma_c_and_mercury.m
+++ b/tests/invalid_purity/pragma_c_and_mercury.m
@@ -35,10 +35,4 @@
 :- pragma foreign_proc("C#",
     c_int_unify(Int::out, Int0::in), [promise_pure], "Int = Int0;").
 
-:- pragma foreign_proc("Erlang",
-    c_int_unify(Int0::in, Int::out), [promise_pure], "Int = Int0").
-
-:- pragma foreign_proc("Erlang",
-    c_int_unify(Int::out, Int0::in), [promise_pure], "Int = Int0").
-
 c_int_unify(X, X).
diff --git a/tests/mmc_make/inc/code.erl b/tests/mmc_make/inc/code.erl
deleted file mode 100644
index 00794d12c..000000000
--- a/tests/mmc_make/inc/code.erl
+++ /dev/null
@@ -1 +0,0 @@
-twos() -> 222.
diff --git a/tests/mmc_make/inc/decl.erl b/tests/mmc_make/inc/decl.erl
deleted file mode 100644
index 79a4b6980..000000000
--- a/tests/mmc_make/inc/decl.erl
+++ /dev/null
@@ -1 +0,0 @@
-ones() -> 111.
diff --git a/tests/mmc_make/include_file.m b/tests/mmc_make/include_file.m
index 0d808a749..0d38444d8 100644
--- a/tests/mmc_make/include_file.m
+++ b/tests/mmc_make/include_file.m
@@ -20,9 +20,6 @@
 :- pragma foreign_decl("C#", include_file("inc/decl.cs")).
 :- pragma foreign_code("C#", include_file("inc/code.cs")).
 
-:- pragma foreign_decl("Erlang", include_file("inc/decl.erl")).
-:- pragma foreign_code("Erlang", include_file("inc/code.erl")).
-
 :- pred test(int::out, int::out) is det.
 
 :- pragma foreign_proc("C",
@@ -49,14 +46,6 @@
     Y = twos();
 ").
 
-:- pragma foreign_proc("Erlang",
-    test(X::out, Y::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
-"
-    X = ones(),
-    Y = twos()
-").
-
 main(!IO) :-
     test(X, Y),
     io.write_int(X, !IO),
diff --git a/tests/par_conj/dep_par_10.m b/tests/par_conj/dep_par_10.m
index 140f0af92..73e26d8d9 100644
--- a/tests/par_conj/dep_par_10.m
+++ b/tests/par_conj/dep_par_10.m
@@ -41,9 +41,3 @@ main(!IO) :-
 "
     Y = X+1;
 ").
-:- pragma foreign_proc("Erlang",
-    fp(X::in) = (Y::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
-"
-    Y = X+1
-").
diff --git a/tests/par_conj/threads_hang.m b/tests/par_conj/threads_hang.m
index bbc7b081e..b2dd5df45 100644
--- a/tests/par_conj/threads_hang.m
+++ b/tests/par_conj/threads_hang.m
@@ -49,16 +49,3 @@ fib(N, F) :-
 "
     alarm(Seconds);
 ").
-
-:- pragma foreign_proc("Erlang",
-    alarm(Seconds::in),
-    [will_not_call_mercury, thread_safe],
-"
-    F = fun() ->
-    receive
-    after Seconds * 1000 ->
-        throw(alarm)
-    end
-    end,
-    spawn_link(F)
-").
diff --git a/tests/purity/promise_pure_test.m b/tests/purity/promise_pure_test.m
index 5feb5a3ee..2ea710e1b 100644
--- a/tests/purity/promise_pure_test.m
+++ b/tests/purity/promise_pure_test.m
@@ -30,7 +30,6 @@ main(!IO) :-
 :- pragma foreign_proc("C", set_x(X::in), [will_not_call_mercury], "x=X;" ).
 :- pragma foreign_proc("C#", set_x(X::in), [will_not_call_mercury], "x=X;" ).
 :- pragma foreign_proc("Java", set_x(X::in), [will_not_call_mercury], "x=X;" ).
-:- pragma foreign_proc("Erlang", set_x(X::in), [], "put(x, X)" ).
 
 :- semipure pred get_x(int::out) is det.
 :- pragma no_inline(get_x/1).
@@ -38,22 +37,12 @@ main(!IO) :-
 :- pragma foreign_proc("C", get_x(X::out), [will_not_call_mercury], "X=x;").
 :- pragma foreign_proc("C#", get_x(X::out), [will_not_call_mercury], "X=x;").
 :- pragma foreign_proc("Java", get_x(X::out), [will_not_call_mercury], "X=x;").
-:- pragma foreign_proc("Erlang", get_x(X::out), [], "
-    X0 = get(x),
-    case X0 of
-        undefined ->
-            X = 0;
-        _ ->
-            X = X0
-    end
-").
 
 :- impure pred incr_x is det.
 :- pragma no_inline(incr_x/0).
 :- pragma foreign_proc("C", incr_x, [will_not_call_mercury], "++x;" ).
 :- pragma foreign_proc("C#", incr_x, [will_not_call_mercury], "++x;" ).
 :- pragma foreign_proc("Java", incr_x, [will_not_call_mercury], "++x;" ).
-:- pragma foreign_proc("Erlang", incr_x, [], "put(x, get(x) + 1)" ).
 
 :- pragma foreign_decl("C", "extern int x;").
 :- pragma foreign_code("C", "int x = 0;").
diff --git a/tests/purity/purity.m b/tests/purity/purity.m
index ad0980d28..096d9f137 100644
--- a/tests/purity/purity.m
+++ b/tests/purity/purity.m
@@ -55,12 +55,6 @@ main -->
 "
     x = X;
 ").
-:- pragma foreign_proc("Erlang",
-    set_x(X::in),
-    [will_not_call_mercury],
-"
-    set_x(X)
-").
 
 :- impure pred incr_x is det.
 :- pragma no_inline(incr_x/0).
@@ -82,12 +76,6 @@ main -->
 "
     ++x;
 ").
-:- pragma foreign_proc("Erlang",
-    incr_x,
-    [will_not_call_mercury],
-"
-    incr_x()
-").
 
 :- semipure pred get_x(int::out) is det.
 :- pragma no_inline(get_x/1).
@@ -109,12 +97,6 @@ main -->
 "
     X = x;
 ").
-:- pragma foreign_proc("Erlang",
-    get_x(X::out),
-    [will_not_call_mercury, promise_semipure],
-"
-    X = get_x()
-").
 
 :- impure pred set_x_inline(int::in) is det.
 :- pragma inline(set_x_inline/1).
@@ -136,12 +118,6 @@ main -->
 "
     x = X;
 ").
-:- pragma foreign_proc("Erlang",
-    set_x_inline(X::in),
-    [will_not_call_mercury],
-"
-    set_x(X)
-").
 
 :- impure pred incr_x_inline is det.
 :- pragma inline(incr_x_inline/0).
@@ -163,12 +139,6 @@ main -->
 "
     ++x;
 ").
-:- pragma foreign_proc("Erlang",
-    incr_x_inline,
-    [will_not_call_mercury],
-"
-    incr_x()
-").
 
 :- semipure pred get_x_inline(int::out) is det.
 :- pragma inline(get_x_inline/1).
@@ -190,32 +160,12 @@ main -->
 "
     X=x;
 ").
-:- pragma foreign_proc("Erlang",
-    get_x_inline(X::out),
-    [will_not_call_mercury, promise_semipure],
-"
-    X=get_x()
-").
 
 :- pragma foreign_decl("C", "extern int x;").
 :- pragma foreign_code("C", "int x = 0;").
 :- pragma foreign_code("C#", "static int x = 0;").
 :- pragma foreign_code("Java", "static int x = 0;").
 
-:- pragma foreign_code("Erlang", "
-    get_x() ->
-        case get(x) of
-            undefined -> 0;
-            X -> X
-        end.
-
-    set_x(X) ->
-        put(x, X).
-
-    incr_x() ->
-        set_x(get_x() + 1).
-").
-
 % tempt compiler to optimize away duplicate semipure goals.
 test1 -->
     { semipure get_x(X) },
diff --git a/tests/purity/purity_opt.m b/tests/purity/purity_opt.m
index 0eb11e039..1a2511f2c 100644
--- a/tests/purity/purity_opt.m
+++ b/tests/purity/purity_opt.m
@@ -48,17 +48,6 @@ test1(X) :-
 :- pragma foreign_code("C#", "static int counter = 1;").
 :- pragma foreign_code("Java", "static int counter = 1;").
 
-:- pragma foreign_code("Erlang", "
-    get_counter() ->
-        case get(counter) of
-            undefined -> 1;
-            X -> X
-        end.
-
-    incr_counter() ->
-        put(counter, get_counter() + 1).
-").
-
 :- impure pred incr(int::out) is det.
 
 :- pragma foreign_proc("C",
@@ -79,12 +68,6 @@ test1(X) :-
 "
     counter++; Val = counter;
 ").
-:- pragma foreign_proc("Erlang",
-    incr(Val::out),
-    [will_not_call_mercury],
-"
-    incr_counter(), Val = get_counter()
-").
 
 :- semipure pred get(int::out) is det.
 
@@ -106,9 +89,3 @@ test1(X) :-
 "
     Val = counter;
 ").
-:- pragma foreign_proc("Erlang",
-    get(Val::out),
-    [will_not_call_mercury, promise_semipure],
-"
-    Val = get_counter()
-").
diff --git a/tests/submodules/external_unification_pred.m b/tests/submodules/external_unification_pred.m
index e7d3453c8..e2613f059 100644
--- a/tests/submodules/external_unification_pred.m
+++ b/tests/submodules/external_unification_pred.m
@@ -26,7 +26,6 @@
     :- pragma foreign_type(c, ft, "int") where equality is unify_ft.
     :- pragma foreign_type("C#", ft, "int") where equality is unify_ft.
     :- pragma foreign_type(java, ft, "Integer") where equality is unify_ft.
-    :- pragma foreign_type(erlang, ft, "") where equality is unify_ft.
 
     :- pred unify_ft(ft::in, ft::in) is semidet.
 
@@ -48,12 +47,6 @@
     "
         SUCCESS_INDICATOR = (X == Y);
     ").
-    :- pragma foreign_proc("Erlang",
-        unify_ft(X::in, Y::in),
-        [promise_pure],
-    "
-        SUCCESS_INDICATOR = (X =:= Y)
-    ").
 
     :- pragma foreign_proc("C",
         create_ft(X::in) = (Y::out),
@@ -73,12 +66,6 @@
     "
         Y = X;
     ").
-    :- pragma foreign_proc("Erlang",
-        create_ft(X::in) = (Y::out),
-        [promise_pure],
-    "
-        Y = X
-    ").
     :- end_module external_unification_pred.sub.
 
 :- import_module external_unification_pred.sub.
diff --git a/tests/submodules/non_word_mutable.m b/tests/submodules/non_word_mutable.m
index 09162232e..99cf020bf 100644
--- a/tests/submodules/non_word_mutable.m
+++ b/tests/submodules/non_word_mutable.m
@@ -25,7 +25,6 @@
 :- pragma foreign_type(c, coord, "coord *").
 :- pragma foreign_type("C#", coord, "coord").
 :- pragma foreign_type("Java", coord, "non_word_mutable.coord").
-:- pragma foreign_type("Erlang", coord, "").
 
 :- pragma foreign_decl(c, "
 typedef struct {
@@ -118,27 +117,6 @@ public static class coord {
     Y = C.y;
 ").
 
-:- pragma foreign_proc("Erlang",
-    new_coord(X::in, Y::in) = (C::out),
-    [will_not_call_mercury, promise_pure],
-"
-    C = {X, Y}
-").
-
-:- pragma foreign_proc("Erlang",
-    x(C::in) = (X::out),
-    [will_not_call_mercury, promise_pure],
-"
-    {X, _} = C
-").
-
-:- pragma foreign_proc("Erlang",
-    y(C::in) = (Y::out),
-    [will_not_call_mercury, promise_pure],
-"
-    {_, Y} = C
-").
-
 :- pragma promise_pure(main/2).
 main(!IO) :-
     % Check whether we get back the same value as we set.
diff --git a/tests/submodules/sm_exp_bug.m b/tests/submodules/sm_exp_bug.m
index bc8f05cc7..8a3304bfa 100644
--- a/tests/submodules/sm_exp_bug.m
+++ b/tests/submodules/sm_exp_bug.m
@@ -49,17 +49,9 @@ main(!IO) :-
     IO = IO0;
 ").
 
-:- pragma foreign_proc("Erlang",
-    call_foreign(_IO0::di, _IO::uo),
-    [may_call_mercury, promise_pure],
-"
-    'WRITE_HELLO'()
-").
-
 :- pragma foreign_export("C", write_hello(di, uo), "WRITE_HELLO").
 :- pragma foreign_export("C#", write_hello(di, uo), "WRITE_HELLO").
 :- pragma foreign_export("Java", write_hello(di, uo), "WRITE_HELLO").
-:- pragma foreign_export("Erlang", write_hello(di, uo), "WRITE_HELLO").
 :- pred write_hello(io::di, io::uo) is det.
 
 write_hello(!IO) :-
diff --git a/tests/typeclasses/impure_methods.m b/tests/typeclasses/impure_methods.m
index ac3f1d3c9..bc41242ef 100644
--- a/tests/typeclasses/impure_methods.m
+++ b/tests/typeclasses/impure_methods.m
@@ -107,22 +107,5 @@ main -->
     Val = foo_counter;
 ").
 
-:- pragma foreign_proc("Erlang",
-    foo_m1(_F::in),
-    [will_not_call_mercury],
-"
-    put(foo_counter,
-    case get(foo_counter) of
-        undefined -> 1;
-        N -> N + 1
-    end)
-").
-:- pragma foreign_proc("Erlang",
-    foo_m2(_F::in, Val::out),
-    [will_not_call_mercury, promise_semipure],
-"
-    Val = get(foo_counter)
-").
-
 goo_m1(_).
 goo_m2(_, 42).
diff --git a/tests/valid/Mmakefile b/tests/valid/Mmakefile
index 447be3b72..da1b9d647 100644
--- a/tests/valid/Mmakefile
+++ b/tests/valid/Mmakefile
@@ -122,7 +122,6 @@ OTHER_PROGS = \
 	empty_submodule \
 	empty_switch \
 	equiv_solns_ia \
-	erl_ite_vars \
 	error \
 	eval \
 	existential_cons \
@@ -266,8 +265,7 @@ OTHER_PROGS = \
 	unused_args_test2 \
 	vn_float \
 	wrapper_arg_lvals \
-	zero_arity \
-	zf_erlang_bug
+	zero_arity
 
 C_INTERFACE_PROGS =
 
diff --git a/tests/valid/big_foreign_type.m b/tests/valid/big_foreign_type.m
index 3020ceacc..0cee688e4 100644
--- a/tests/valid/big_foreign_type.m
+++ b/tests/valid/big_foreign_type.m
@@ -11,22 +11,18 @@
 :- type foo.
 :- pragma foreign_type(c, foo, "struct Foo").
 :- pragma foreign_type(java, foo, "Foo").
-:- pragma foreign_type(erlang, foo, "").
 
 :- type foo2.
 :- pragma foreign_type(c, foo2, "char").
 :- pragma foreign_type(java, foo2, "Character").
-:- pragma foreign_type(erlang, foo2, "").
 
 :- type foo3.
 :- pragma foreign_type(c, foo3, "double").
 :- pragma foreign_type(java, foo3, "Double").
-:- pragma foreign_type(erlang, foo3, "").
 
 :- type foo4.
 :- pragma foreign_type(c, foo4, "enum e").
 :- pragma foreign_type(java, foo4, "e").
-:- pragma foreign_type(erlang, foo4, "").
 
 :- func bar(foo) = foo.
 :- func bar2(foo2) = foo2.
@@ -91,15 +87,6 @@ enum e { e0, e1, e2 };
 :- pragma foreign_proc("Java", bar4(X::in) = (Y::out),
     [will_not_call_mercury, promise_pure], "Y = X;").
 
-:- pragma foreign_proc("Erlang", bar(X::in) = (Y::out),
-    [will_not_call_mercury, promise_pure], "Y = X").
-:- pragma foreign_proc("Erlang", bar2(X::in) = (Y::out),
-    [will_not_call_mercury, promise_pure], "Y = X").
-:- pragma foreign_proc("Erlang", bar3(X::in) = (Y::out),
-    [will_not_call_mercury, promise_pure], "Y = 2.0 * X").
-:- pragma foreign_proc("Erlang", bar4(X::in) = (Y::out),
-    [will_not_call_mercury, promise_pure], "Y = X").
-
 baz(X) = X.
 baz2(X) = X.
 baz3(X) = X.
diff --git a/tests/valid/erl_ite_vars.m b/tests/valid/erl_ite_vars.m
deleted file mode 100644
index 0d24dd7dd..000000000
--- a/tests/valid/erl_ite_vars.m
+++ /dev/null
@@ -1,40 +0,0 @@
-%---------------------------------------------------------------------------%
-% vim: ts=4 sw=4 et ft=mercury
-%---------------------------------------------------------------------------%
-%
-% This is a regression test for a bug in the generation of if-then-else goals
-% in the Erlang backend.  The calculation of the variables bound by the then
-% branch was wrong -- it included variables bound in the condition.
-
-:- module erl_ite_vars.
-:- interface.
-
-:- import_module list.
-
-:- type baz
-    --->    and(baz, baz)
-    ;       bar(string)
-    ;       quux(string).
-
-:- pred foo(list(string)::in, list(string)::out, baz::out) is semidet.
-
-:- implementation.
-
-foo(List, Rest, Expression):-
-    ( List = ["(", "(" | R] ->
-        foo(["(" | R], Rem, Exp)
-    ;
-        List = ["(", "bar", Name | _],
-        Rem = [],
-        Exp = bar(Name)
-    ;
-        List = ["(", "quux", Name, ")" | Rem],
-        Exp = quux(Name)
-    ),
-    ( Rem = [", " | Next] ->
-        foo(Next, Rest, RestExp),
-        Expression = and(Exp, RestExp)
-    ;
-        Rest = [],
-        Expression = Exp
-    ).
diff --git a/tests/valid/flatten_conj_bug.m b/tests/valid/flatten_conj_bug.m
index 2fce44efa..5fbf492e8 100644
--- a/tests/valid/flatten_conj_bug.m
+++ b/tests/valid/flatten_conj_bug.m
@@ -44,9 +44,3 @@ unwrap_cvar(cvar_wrapper(V)) = unsafe_any_to_cvar(V).
 "
     Y = X;
 ").
-:- pragma foreign_proc("Erlang",
-    unsafe_any_to_cvar(X::in) = (Y::out(cvar)),
-    [will_not_call_mercury, promise_pure],
-"
-    Y = X
-").
diff --git a/tests/valid/ho_and_type_spec_bug.m b/tests/valid/ho_and_type_spec_bug.m
index 87c83b928..efb563bc8 100644
--- a/tests/valid/ho_and_type_spec_bug.m
+++ b/tests/valid/ho_and_type_spec_bug.m
@@ -63,12 +63,6 @@ beta(_E, V, _R0, R) :-
     /* V */
     F = null;
 ").
-:- pragma foreign_proc("Erlang",
-    gamma(V::in) = (F::out),
-    [will_not_call_mercury, promise_pure],
-"
-    F = V
-").
 
 :- pred foldl(pred(T, U, U), sparse_bitset(T), U, U) <= foo(T).
 :- mode foldl(pred(in, in, out) is det, in, in, out) is det.
diff --git a/tests/valid/inst_perf_bug_1.m b/tests/valid/inst_perf_bug_1.m
index 63ac0901c..58271796a 100644
--- a/tests/valid/inst_perf_bug_1.m
+++ b/tests/valid/inst_perf_bug_1.m
@@ -49,4 +49,3 @@
 :- implementation.
 
 :- pragma external_pred(p/1).
-:- pragma foreign_code("Erlang", "p_1_p_0(_) -> void.").
diff --git a/tests/valid/mert.m b/tests/valid/mert.m
index 15da066f5..dc8bcca8f 100644
--- a/tests/valid/mert.m
+++ b/tests/valid/mert.m
@@ -50,13 +50,11 @@
 :- pragma foreign_type("C", c_candidate, "void *",
     [stable, can_pass_as_mercury_type]).
 :- pragma foreign_type("Java", c_candidate, "Object").
-:- pragma foreign_type("Erlang", c_candidate, "").
 
 :- type data. % C-implemented, represents the whole nbestlist
 :- pragma foreign_type("C", data, "void *",
     [stable, can_pass_as_mercury_type]).
 :- pragma foreign_type("Java", data, "Object").
-:- pragma foreign_type("Erlang", data, "").
 
 :- type feats == list(float). % score breakdown
 
@@ -82,13 +80,6 @@ new_c_candidate(F, C) = new_c_candidate(length(F), F, length(C), C).
     C = null;
 ").
 
-:- pragma foreign_proc("Erlang",
-new_c_candidate(NFeats::in, Feats::in, NComps::in, Comps::in) = (C::uo),
-  [promise_pure, will_not_call_mercury, thread_safe], "
-  % NFeats, Feats, NComps, Comps, C
-  C = void
-").
-
 :- func nbestlist_to_data(scorednbestlist) = data.
 
   % construct data (using GC_malloc)
@@ -124,20 +115,11 @@ nbestlist_to_data(NBL) = OutData :-
     /* NSents, CandsPerSent, TotNCands, AllCands */
     D = null;
 ").
-:- pragma foreign_proc("Erlang",
-    new_c_data(NSents::in, CandsPerSent::in, TotNCands::in, AllCands::in)
-        = (D::uo),
-    [promise_pure, will_not_call_mercury, thread_safe],
-"
-    % NSents, CandsPerSent, TotNCands, AllCands
-    D = void
-").
 
 :- type point. % C-implemented, represents the whole nbestlist
 :- pragma foreign_type("C", point, "void *",
     [stable, can_pass_as_mercury_type]).
 :- pragma foreign_type("Java", point, "Object").
-:- pragma foreign_type("Erlang", point, "").
 
 optimize(NBL, Rand, InW) = OutW :-
     Data = nbestlist_to_data(NBL),
@@ -176,14 +158,6 @@ optimize(NBL, Rand, InW) = OutW :-
     /* Data, BestSoFar, Min, Max, Iter */
     Out = null;
 ").
-:- pragma foreign_proc("Erlang",
-    optimize_random(Data::in, BestSoFar::in, Min::in, Max::in, Iter::in)
-        = (Out::out),
-    [promise_pure, will_not_call_mercury, thread_safe],
-"
-    % Data, BestSoFar, Min, Max, Iter
-    Out = void
-").
 
 :- func optimize_koehn(data, point) = point.
   % destructively replace contents of point doing one iteration of optimization
@@ -201,13 +175,6 @@ optimize(NBL, Rand, InW) = OutW :-
     /* Data, In, Out */
     Out = null;
 ").
-:- pragma foreign_proc("Erlang",
-    optimize_koehn(Data::in, In::in) = (Out::out),
-    [promise_pure, will_not_call_mercury, thread_safe],
-"
-    % Data, In, Out
-    Out = void
-").
 
 :- func construct_point(list(float)) = point.
   % construct a new point, uses plain malloc!
@@ -228,12 +195,6 @@ construct_point(List::in) = (Point::out),
     /* List, Point */
     Point = null;
 ").
-:- pragma foreign_proc("Erlang",
-    construct_point(List::in) = (Point::out),
-    [promise_pure, will_not_call_mercury, thread_safe],
-"
-    Point = List
-").
 
 :- pragma foreign_proc("C",
     deconstruct_point(Point::in) = (List::out),
@@ -250,12 +211,6 @@ construct_point(List::in) = (Point::out),
     List = null;
 ").
 
-:- pragma foreign_proc("Erlang",
-    deconstruct_point(Point::in) = (List::out),
-    [promise_pure, will_not_call_mercury, thread_safe],
-"
-    List = Point
-").
 
 :- type bleucomps == list(int).
 
diff --git a/tests/valid/param_mode_bug.m b/tests/valid/param_mode_bug.m
index 73a503eaf..0b017587e 100644
--- a/tests/valid/param_mode_bug.m
+++ b/tests/valid/param_mode_bug.m
@@ -45,12 +45,6 @@ foo(Y::out(I), X::in(I)) :-
 "
     Y = X;
 ").
-:- pragma foreign_proc("Erlang",
-    foo_2(Y::out(I), X::in(I)),
-    [promise_pure, thread_safe, will_not_call_mercury],
-"
-    Y = X
-").
 
 :- pragma foreign_export("C", bar(in(I), out(I)), "BAR").
 bar(X, X).
diff --git a/tests/valid/solver_type_bug.m b/tests/valid/solver_type_bug.m
index e0dae8dea..ded38ed83 100644
--- a/tests/valid/solver_type_bug.m
+++ b/tests/valid/solver_type_bug.m
@@ -52,11 +52,6 @@ p2(X) :-
 :- mode q2(in(any)) is nondet.
 :- pragma external_pred(q2/1).
 
-:- pragma foreign_code("Erlang", "
-q1_1_p_0(_, _) -> void.
-q2_1_p_0(_, _) -> void.
-").
-
 :- pragma foreign_code("Java", "
     private static void q1_1_p_0(int a1, jmercury.runtime.MethodPtr a2, java.lang.Object a3) {}
     private static void q2_1_p_0(Bar_0 a1, jmercury.runtime.MethodPtr a2, java.lang.Object a3) {}
diff --git a/tests/valid/tricky_assert2.m b/tests/valid/tricky_assert2.m
index e4c50d204..a1f30f6ea 100644
--- a/tests/valid/tricky_assert2.m
+++ b/tests/valid/tricky_assert2.m
@@ -11,4 +11,3 @@
 
 :- implementation.
 :- pragma external_pred(tricky_assert2.local/0).
-:- pragma foreign_code("Erlang", "local_0_p_0() -> void.").
diff --git a/tests/valid/zf_erlang_bug.m b/tests/valid/zf_erlang_bug.m
deleted file mode 100644
index 4111099ee..000000000
--- a/tests/valid/zf_erlang_bug.m
+++ /dev/null
@@ -1,53 +0,0 @@
-% vim: ft=mercury ts=4 sw=4 et wm=0 tw=0
-%
-% This module results in the following error message from the Erlang compiler
-% when compiled in the erlang grade:
-%
-%    Mercury/erls/zf_erlang_bug.erl:64:
-%    variable 'STATE_VARIABLE_IO_1_12' unsafe in 'case' (line 43)
-%
-% This was with Mercury rotd-2009-06-02 (+ a few of the diffs posted that day).
-% To reproduce:
-%
-%   mmc --grade erlang --make zf_erlang_bug.beam
-%
-% This test case is a cut-down version of the module zinc_frontend from
-% rotd-2009-05-31 of the MiniZinc distribution.
-%
-%---------------------------------------------------------------------------%
-
-:- module zf_erlang_bug.
-:- interface.
-
-:- import_module list.
-:- import_module io.
-
-%---------------------------------------------------------------------------%
-%---------------------------------------------------------------------------%
-
-:- type writer(T) == ( pred( T, io, io)        ).
-:- inst writer    == ( pred(in, di, uo) is det ).
-
-:- pred do_io_stage(list(string), writer(A), A, io, io).
-:- mode do_io_stage(in, in(writer), in, di, uo) is det.
-
-%---------------------------------------------------------------------------%
-%---------------------------------------------------------------------------%
-
-:- implementation.
-
-do_io_stage(StageNames, PreDumper, Input, !IO) :-
-    ( if member("foo", StageNames) then
-        PreDumper(Input, !IO)
-      else
-        true
-    ),
-    ( if member("bar", StageNames) then
-        PreDumper(Input, !IO)
-      else
-        true
-    ).
-
-%---------------------------------------------------------------------------%
-:- end_module zf_erlang_bug.
-%---------------------------------------------------------------------------%
diff --git a/tests/valid_seq/exported_foreign_type_2.m b/tests/valid_seq/exported_foreign_type_2.m
index e3829fed7..d0acdb890 100644
--- a/tests/valid_seq/exported_foreign_type_2.m
+++ b/tests/valid_seq/exported_foreign_type_2.m
@@ -13,8 +13,6 @@
     where equality is int_equals, comparison is int_compare.
 :- pragma foreign_type("Java", t, "Integer")
     where equality is int_equals, comparison is int_compare.
-:- pragma foreign_type("Erlang", t, "")
-    where equality is int_equals, comparison is int_compare.
 
 :- pred int_equals(t::in, t::in) is semidet.
 :- pred int_compare(comparison_result::uo, t::in, t::in) is det.
@@ -47,13 +45,6 @@
     SUCCESS_INDICATOR = (T1 == T2);
 ").
 
-:- pragma foreign_proc("Erlang",
-    int_equals(T1::in, T2::in),
-    [promise_pure],
-"
-    SUCCESS_INDICATOR = (T1 =:= T2)
-").
-
 %---------------------%
 
 int_compare(Result, T1, T2) :-
@@ -89,11 +80,4 @@ int_compare(Result, T1, T2) :-
     Result = (T1 < T2) ? -1 : ((T1 == T2) ? 0 : 1);
 ").
 
-:- pragma foreign_proc("Erlang",
-    int_compare_2(Result::out, T1::in, T2::in),
-    [promise_pure],
-"
-    Result = if T1 < T2 -> -1; T1 =:= T2 -> 0 ; true -> 1 end
-").
-
 %---------------------------------------------------------------------------%
diff --git a/tests/valid_seq/intermod_impure2.m b/tests/valid_seq/intermod_impure2.m
index 000088614..2cfa7390c 100644
--- a/tests/valid_seq/intermod_impure2.m
+++ b/tests/valid_seq/intermod_impure2.m
@@ -33,10 +33,3 @@ intermod_impure(Int) :-
     System.out.println(""Output from impure predicate\\n"");
     Int = 2;
 ").
-:- pragma foreign_proc("Erlang",
-    intermod_impure_2(Int::out),
-    [will_not_call_mercury],
-"
-    io:format(""Output from impure predicate\\n""),
-    Int = 2
-").
diff --git a/tests/warnings/purity_warnings.m b/tests/warnings/purity_warnings.m
index 17d199a86..e991eb432 100644
--- a/tests/warnings/purity_warnings.m
+++ b/tests/warnings/purity_warnings.m
@@ -103,20 +103,14 @@ static int x = 0;
 :- pragma foreign_proc("C", set_x(X::in), [will_not_call_mercury], "x=X;" ).
 :- pragma foreign_proc("C#", set_x(X::in), [will_not_call_mercury], "x=X;" ).
 :- pragma foreign_proc("Java", set_x(X::in), [will_not_call_mercury], "x=X;" ).
-:- pragma foreign_proc("Erlang", set_x(X::in), [will_not_call_mercury],
-    "put(x, X)" ).
 
 :- impure pred incr_x is det.
 :- pragma foreign_proc("C", incr_x, [will_not_call_mercury], "++x;" ).
 :- pragma foreign_proc("C#", incr_x, [will_not_call_mercury], "++x;" ).
 :- pragma foreign_proc("Java", incr_x, [will_not_call_mercury], "++x;" ).
-:- pragma foreign_proc("Erlang", incr_x, [will_not_call_mercury],
-    "put(x, get(x) + 1)" ).
 
 :- semipure pred get_x(int::out) is det.
 :- pragma promise_semipure(get_x/1).
 :- pragma foreign_proc("C", get_x(X::out), [will_not_call_mercury], "X=x;").
 :- pragma foreign_proc("C#", get_x(X::out), [will_not_call_mercury], "X=x;").
 :- pragma foreign_proc("Java", get_x(X::out), [will_not_call_mercury], "X=x;").
-:- pragma foreign_proc("Erlang", get_x(X::out), [will_not_call_mercury],
-    "X = get(x)").
diff --git a/tests/warnings/singleton_test.exp b/tests/warnings/singleton_test.exp
index 4588658c4..a382921cc 100644
--- a/tests/warnings/singleton_test.exp
+++ b/tests/warnings/singleton_test.exp
@@ -14,14 +14,14 @@ singleton_test.m:036: In clause for function `my_append_func'/2:
 singleton_test.m:036:   warning: variable `T' occurs only once in this scope.
 singleton_test.m:038: In the C code for predicate `my_c_pred'/3:
 singleton_test.m:038:   warning: variable `Y' does not occur in the C code.
-singleton_test.m:055: In the C code for function `my_c_func'/2:
-singleton_test.m:055:   warning: variable `X' does not occur in the C code.
-singleton_test.m:074: In the C code for predicate `c_hello_world'/3:
-singleton_test.m:074:   warning: variable `Msg' does not occur in the C code.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variable `_D' occurs more than once in this
-singleton_test.m:095:   scope.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variables `A, B' occur only once in this
-singleton_test.m:095:   scope.
+singleton_test.m:051: In the C code for function `my_c_func'/2:
+singleton_test.m:051:   warning: variable `X' does not occur in the C code.
+singleton_test.m:066: In the C code for predicate `c_hello_world'/3:
+singleton_test.m:066:   warning: variable `Msg' does not occur in the C code.
+singleton_test.m:082: In clause for predicate `test_head'/6:
+singleton_test.m:082:   warning: variable `_D' occurs more than once in this
+singleton_test.m:082:   scope.
+singleton_test.m:082: In clause for predicate `test_head'/6:
+singleton_test.m:082:   warning: variables `A, B' occur only once in this
+singleton_test.m:082:   scope.
 For more information, recompile with `-E'.
diff --git a/tests/warnings/singleton_test.exp2 b/tests/warnings/singleton_test.exp2
index 06b918400..1fa1c085c 100644
--- a/tests/warnings/singleton_test.exp2
+++ b/tests/warnings/singleton_test.exp2
@@ -14,14 +14,14 @@ singleton_test.m:036: In clause for function `my_append_func'/2:
 singleton_test.m:036:   warning: variable `T' occurs only once in this scope.
 singleton_test.m:042: In the C# code for predicate `my_c_pred'/3:
 singleton_test.m:042:   warning: variable `Y' does not occur in the C# code.
-singleton_test.m:059: In the C# code for function `my_c_func'/2:
-singleton_test.m:059:   warning: variable `X' does not occur in the C# code.
-singleton_test.m:079: In the C# code for predicate `c_hello_world'/3:
-singleton_test.m:079:   warning: variable `Msg' does not occur in the C# code.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variable `_D' occurs more than once in this
-singleton_test.m:095:   scope.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variables `A, B' occur only once in this
-singleton_test.m:095:   scope.
+singleton_test.m:055: In the C# code for function `my_c_func'/2:
+singleton_test.m:055:   warning: variable `X' does not occur in the C# code.
+singleton_test.m:071: In the C# code for predicate `c_hello_world'/3:
+singleton_test.m:071:   warning: variable `Msg' does not occur in the C# code.
+singleton_test.m:082: In clause for predicate `test_head'/6:
+singleton_test.m:082:   warning: variable `_D' occurs more than once in this
+singleton_test.m:082:   scope.
+singleton_test.m:082: In clause for predicate `test_head'/6:
+singleton_test.m:082:   warning: variables `A, B' occur only once in this
+singleton_test.m:082:   scope.
 For more information, recompile with `-E'.
diff --git a/tests/warnings/singleton_test.exp3 b/tests/warnings/singleton_test.exp3
index d736fe6c6..0b975a3ce 100644
--- a/tests/warnings/singleton_test.exp3
+++ b/tests/warnings/singleton_test.exp3
@@ -14,15 +14,15 @@ singleton_test.m:036: In clause for function `my_append_func'/2:
 singleton_test.m:036:   warning: variable `T' occurs only once in this scope.
 singleton_test.m:046: In the Java code for predicate `my_c_pred'/3:
 singleton_test.m:046:   warning: variable `Y' does not occur in the Java code.
-singleton_test.m:063: In the Java code for function `my_c_func'/2:
-singleton_test.m:063:   warning: variable `X' does not occur in the Java code.
-singleton_test.m:084: In the Java code for predicate `c_hello_world'/3:
-singleton_test.m:084:   warning: variable `Msg' does not occur in the Java
-singleton_test.m:084:   code.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variable `_D' occurs more than once in this
-singleton_test.m:095:   scope.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variables `A, B' occur only once in this
-singleton_test.m:095:   scope.
+singleton_test.m:059: In the Java code for function `my_c_func'/2:
+singleton_test.m:059:   warning: variable `X' does not occur in the Java code.
+singleton_test.m:076: In the Java code for predicate `c_hello_world'/3:
+singleton_test.m:076:   warning: variable `Msg' does not occur in the Java
+singleton_test.m:076:   code.
+singleton_test.m:082: In clause for predicate `test_head'/6:
+singleton_test.m:082:   warning: variable `_D' occurs more than once in this
+singleton_test.m:082:   scope.
+singleton_test.m:082: In clause for predicate `test_head'/6:
+singleton_test.m:082:   warning: variables `A, B' occur only once in this
+singleton_test.m:082:   scope.
 For more information, recompile with `-E'.
diff --git a/tests/warnings/singleton_test.exp4 b/tests/warnings/singleton_test.exp4
deleted file mode 100644
index 09b39d8ac..000000000
--- a/tests/warnings/singleton_test.exp4
+++ /dev/null
@@ -1,30 +0,0 @@
-singleton_test.m:013: In function `my_append_func'/2:
-singleton_test.m:013:   warning: unresolved polymorphism.
-singleton_test.m:013:   The variables with unbound types were:
-singleton_test.m:013:     L2: V_1
-singleton_test.m:013:     L1: V_1
-singleton_test.m:013:   The unbound type variables will be implicitly bound to
-singleton_test.m:013:   the builtin type `void'.
-singleton_test.m:031: In clause for predicate `my_append'/3:
-singleton_test.m:031:   warning: variable `L2' occurs only once in this scope.
-singleton_test.m:035: In clause for function `my_append_func'/2:
-singleton_test.m:035:   warning: variables `L1, L2' occur only once in this
-singleton_test.m:035:   scope.
-singleton_test.m:036: In clause for function `my_append_func'/2:
-singleton_test.m:036:   warning: variable `T' occurs only once in this scope.
-singleton_test.m:050: In the Erlang code for predicate `my_c_pred'/3:
-singleton_test.m:050:   warning: variable `Y' does not occur in the Erlang
-singleton_test.m:050:   code.
-singleton_test.m:067: In the Erlang code for function `my_c_func'/2:
-singleton_test.m:067:   warning: variable `X' does not occur in the Erlang
-singleton_test.m:067:   code.
-singleton_test.m:089: In the Erlang code for predicate `c_hello_world'/3:
-singleton_test.m:089:   warning: variable `Msg' does not occur in the Erlang
-singleton_test.m:089:   code.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variable `_D' occurs more than once in this
-singleton_test.m:095:   scope.
-singleton_test.m:095: In clause for predicate `test_head'/6:
-singleton_test.m:095:   warning: variables `A, B' occur only once in this
-singleton_test.m:095:   scope.
-For more information, recompile with `-E'.
diff --git a/tests/warnings/singleton_test.m b/tests/warnings/singleton_test.m
index bf2cf0806..45e402805 100644
--- a/tests/warnings/singleton_test.m
+++ b/tests/warnings/singleton_test.m
@@ -1,7 +1,7 @@
 %---------------------------------------------------------------------------%
 % vim: ts=4 sw=4 et ft=mercury
 %---------------------------------------------------------------------------%
-% The .exp files are for C, C#, Java and Erlang respectively.
+% The .exp files are for C, C# and Java respectively.
 
 :- module singleton_test.
 :- interface.
@@ -47,10 +47,6 @@ my_append_func([H | T], L) = [H | my_append_func(L, L)].
     [promise_pure, will_not_call_mercury], "
     Z = 2 * X;
 ").
-:- pragma foreign_proc("Erlang", my_c_pred(X::in, Y::in, Z::out),
-    [promise_pure, will_not_call_mercury], "
-    Z = 2 * X
-").
 
 :- pragma foreign_proc("C", my_c_func(X::in, Y::in) = (Z::out),
     [promise_pure, will_not_call_mercury], "
@@ -64,10 +60,6 @@ my_append_func([H | T], L) = [H | my_append_func(L, L)].
     [promise_pure, will_not_call_mercury], "
     Z = 2 * Y;
 ").
-:- pragma foreign_proc("Erlang", my_c_func(X::in, Y::in) = (Z::out),
-    [promise_pure, will_not_call_mercury], "
-    Z = 2 * Y
-").
 
 :- pragma foreign_decl("C", "#include <stdio.h>").
 
@@ -86,10 +78,5 @@ my_append_func([H | T], L) = [H | my_append_func(L, L)].
     System.out.println(""Hello, world"");
     IO = IO0;
 ").
-:- pragma foreign_proc("Erlang", c_hello_world(Msg::in, IO0::di, IO::uo),
-        [promise_pure, will_not_call_mercury], "
-    io:format(""Hello, world""),
-    IO = IO0
-").
 
 test_head(A, B, C, _D, C, _D).
diff --git a/tests/warnings/warn_contiguous_foreign.m b/tests/warnings/warn_contiguous_foreign.m
index 13c2855cf..aba044cb9 100644
--- a/tests/warnings/warn_contiguous_foreign.m
+++ b/tests/warnings/warn_contiguous_foreign.m
@@ -60,10 +60,3 @@ p(N, M) :-
 "
     M = N + 1;
 ").
-
-:- pragma foreign_proc("Erlang",
-    p(N::in, M::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
-"
-    M = N + 1
-").
diff --git a/tests/warnings/warn_succ_ind.exp b/tests/warnings/warn_succ_ind.exp
index 8c4aee442..127b2ecc6 100644
--- a/tests/warnings/warn_succ_ind.exp
+++ b/tests/warnings/warn_succ_ind.exp
@@ -1,8 +1,8 @@
 warn_succ_ind.m:030: Warning: the C code for predicate `foo'/2 may set
 warn_succ_ind.m:030:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:062: Warning: the C code for predicate `foo2'/2 may set
-warn_succ_ind.m:062:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:094: Warning: the C code for predicate `bar'/2 does not appear
-warn_succ_ind.m:094:   to set `SUCCESS_INDICATOR', but it can fail.
-warn_succ_ind.m:122: Warning: the C code for predicate `bar2'/2 does not appear
-warn_succ_ind.m:122:   to set `SUCCESS_INDICATOR', but it can fail.
+warn_succ_ind.m:054: Warning: the C code for predicate `foo2'/2 may set
+warn_succ_ind.m:054:   `SUCCESS_INDICATOR', but it cannot fail.
+warn_succ_ind.m:078: Warning: the C code for predicate `bar'/2 does not appear
+warn_succ_ind.m:078:   to set `SUCCESS_INDICATOR', but it can fail.
+warn_succ_ind.m:099: Warning: the C code for predicate `bar2'/2 does not appear
+warn_succ_ind.m:099:   to set `SUCCESS_INDICATOR', but it can fail.
diff --git a/tests/warnings/warn_succ_ind.exp2 b/tests/warnings/warn_succ_ind.exp2
index 5bb4837dc..e5b1f4f25 100644
--- a/tests/warnings/warn_succ_ind.exp2
+++ b/tests/warnings/warn_succ_ind.exp2
@@ -1,8 +1,8 @@
 warn_succ_ind.m:038: Warning: the C# code for predicate `foo'/2 may set
 warn_succ_ind.m:038:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:070: Warning: the C# code for predicate `foo2'/2 may set
-warn_succ_ind.m:070:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:101: Warning: the C# code for predicate `bar'/2 does not appear
-warn_succ_ind.m:101:   to set `SUCCESS_INDICATOR', but it can fail.
-warn_succ_ind.m:129: Warning: the C# code for predicate `bar2'/2 does not
-warn_succ_ind.m:129:   appear to set `SUCCESS_INDICATOR', but it can fail.
+warn_succ_ind.m:062: Warning: the C# code for predicate `foo2'/2 may set
+warn_succ_ind.m:062:   `SUCCESS_INDICATOR', but it cannot fail.
+warn_succ_ind.m:085: Warning: the C# code for predicate `bar'/2 does not appear
+warn_succ_ind.m:085:   to set `SUCCESS_INDICATOR', but it can fail.
+warn_succ_ind.m:106: Warning: the C# code for predicate `bar2'/2 does not
+warn_succ_ind.m:106:   appear to set `SUCCESS_INDICATOR', but it can fail.
diff --git a/tests/warnings/warn_succ_ind.exp3 b/tests/warnings/warn_succ_ind.exp3
index 9e3e350c7..025b8b034 100644
--- a/tests/warnings/warn_succ_ind.exp3
+++ b/tests/warnings/warn_succ_ind.exp3
@@ -1,8 +1,8 @@
 warn_succ_ind.m:046: Warning: the Java code for predicate `foo'/2 may set
 warn_succ_ind.m:046:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:078: Warning: the Java code for predicate `foo2'/2 may set
-warn_succ_ind.m:078:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:108: Warning: the Java code for predicate `bar'/2 does not
-warn_succ_ind.m:108:   appear to set `SUCCESS_INDICATOR', but it can fail.
-warn_succ_ind.m:136: Warning: the Java code for predicate `bar2'/2 does not
-warn_succ_ind.m:136:   appear to set `SUCCESS_INDICATOR', but it can fail.
+warn_succ_ind.m:070: Warning: the Java code for predicate `foo2'/2 may set
+warn_succ_ind.m:070:   `SUCCESS_INDICATOR', but it cannot fail.
+warn_succ_ind.m:092: Warning: the Java code for predicate `bar'/2 does not
+warn_succ_ind.m:092:   appear to set `SUCCESS_INDICATOR', but it can fail.
+warn_succ_ind.m:113: Warning: the Java code for predicate `bar2'/2 does not
+warn_succ_ind.m:113:   appear to set `SUCCESS_INDICATOR', but it can fail.
diff --git a/tests/warnings/warn_succ_ind.exp4 b/tests/warnings/warn_succ_ind.exp4
deleted file mode 100644
index 64711a603..000000000
--- a/tests/warnings/warn_succ_ind.exp4
+++ /dev/null
@@ -1,8 +0,0 @@
-warn_succ_ind.m:054: Warning: the Erlang code for predicate `foo'/2 may set
-warn_succ_ind.m:054:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:086: Warning: the Erlang code for predicate `foo2'/2 may set
-warn_succ_ind.m:086:   `SUCCESS_INDICATOR', but it cannot fail.
-warn_succ_ind.m:115: Warning: the Erlang code for predicate `bar'/2 does not
-warn_succ_ind.m:115:   appear to set `SUCCESS_INDICATOR', but it can fail.
-warn_succ_ind.m:143: Warning: the Erlang code for predicate `bar2'/2 does not
-warn_succ_ind.m:143:   appear to set `SUCCESS_INDICATOR', but it can fail.
diff --git a/tests/warnings/warn_succ_ind.m b/tests/warnings/warn_succ_ind.m
index 05bac9f32..847df04ed 100644
--- a/tests/warnings/warn_succ_ind.m
+++ b/tests/warnings/warn_succ_ind.m
@@ -4,8 +4,8 @@
 %
 % Test --warn-suspicious-foreign-procs for SUCCESS_INDICATOR.
 %
-% The .exp, .exp2, .exp3 and .exp4 files contain the expected warnings
-% for the C, C#, Java and Erlang foreign_procs respectively.
+% The .exp, .exp2, .exp3 files contain the expected warnings
+% for the C, C# and Java foreign_procs respectively.
 %
 % XXX We should add all foreign_procs to the HLDS to enable checks like this,
 % and only *after* these checks should we delete from the HLDS any
@@ -51,14 +51,6 @@
     SUCCESS_INDICATOR = false;
 ").
 
-:- pragma foreign_proc("Erlang",
-    foo(X::in, Y::out),
-    [will_not_call_mercury, promise_pure],
-"
-    X = Y,
-    SUCCESS_INDICATOR = false
-").
-
 :- pragma foreign_proc("C",
     foo2(X::in, Y::out),
     [will_not_call_mercury, promise_pure],
@@ -83,14 +75,6 @@
     SUCCESS_INDICATOR = false;
 ").
 
-:- pragma foreign_proc("Erlang",
-    foo2(X::in, Y::out),
-    [will_not_call_mercury, promise_pure],
-"
-    X = Y,
-    SUCCESS_INDICATOR = false
-").
-
 :- pragma foreign_proc("C",
     bar(X::in, Y::out),
     [will_not_call_mercury, promise_pure],
@@ -112,13 +96,6 @@
     X = Y;
 ").
 
-:- pragma foreign_proc("Erlang",
-    bar(X::in, Y::out),
-    [will_not_call_mercury, promise_pure],
-"
-    X = Y
-").
-
 :- pragma foreign_proc("C",
     bar2(X::in, Y::out),
     [will_not_call_mercury, promise_pure],
@@ -140,11 +117,4 @@
     X = Y;
 ").
 
-:- pragma foreign_proc("Erlang",
-    bar2(X::in, Y::out),
-    [will_not_call_mercury, promise_pure],
-"
-    X = Y
-").
-
 :- end_module warn_succ_ind.
-- 
2.28.0



More information about the reviews mailing list