Browse Source

add tests for untyped pointer arithmetic warnings

git-svn-id: trunk@4820 -
micha 19 years ago
parent
commit
f47f8e6af1
4 changed files with 38 additions and 0 deletions
  1. 3 0
      .gitattributes
  2. 12 0
      tests/tbf/tb0182.pp
  3. 12 0
      tests/tbf/tb0183.pp
  4. 11 0
      tests/tbs/tb0504.pp

+ 3 - 0
.gitattributes

@@ -5336,6 +5336,8 @@ tests/tbf/tb0178.pp svneol=native#text/plain
 tests/tbf/tb0179.pp svneol=native#text/plain
 tests/tbf/tb0180.pp svneol=native#text/plain
 tests/tbf/tb0181.pp svneol=native#text/plain
+tests/tbf/tb0182.pp svneol=native#text/plain
+tests/tbf/tb0183.pp svneol=native#text/plain
 tests/tbf/ub0115.pp svneol=native#text/plain
 tests/tbf/ub0149.pp svneol=native#text/plain
 tests/tbf/ub0158a.pp svneol=native#text/plain
@@ -5836,6 +5838,7 @@ tests/tbs/tb0500.pp svneol=native#text/plain
 tests/tbs/tb0501.pp svneol=native#text/plain
 tests/tbs/tb0502.pp svneol=native#text/plain
 tests/tbs/tb0503.pp svneol=native#text/plain
+tests/tbs/tb0504.pp svneol=native#text/plain
 tests/tbs/ub0060.pp svneol=native#text/plain
 tests/tbs/ub0069.pp svneol=native#text/plain
 tests/tbs/ub0119.pp svneol=native#text/plain

+ 12 - 0
tests/tbf/tb0182.pp

@@ -0,0 +1,12 @@
+{ %OPT=-Sew }
+{ %fail }
+
+{$T-}
+
+var
+  i: integer;
+  p: pointer;
+begin
+  p := @i+5;
+  i := integer(p-p);
+end.

+ 12 - 0
tests/tbf/tb0183.pp

@@ -0,0 +1,12 @@
+{ %OPT=-Sew }
+{ %fail }
+
+{$T-}
+
+var
+  i: integer;
+  p: pointer;
+begin
+  p := pointer(@i)+5;
+  i := integer(@i-p);
+end.

+ 11 - 0
tests/tbs/tb0504.pp

@@ -0,0 +1,11 @@
+{ %OPT=-Sew }
+
+{$T-}
+
+var
+  i: integer;
+  p: pointer;
+begin
+  p := pointer(@i)+5;
+  i := integer(p-p);
+end.