summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-11-30 23:36:38 +0100
committerGitHub <noreply@github.com>2020-11-30 23:36:38 +0100
commit2e4b6b94e675a7de96fcf2b3e8ed4224dccd5747 (patch)
tree7b11aeb6f15e0ab48c47dd2277f1434c98b9f468 /tests
parentbb4b27a2ca414f06fbb9d14ff76fa02a088ac141 (diff)
downloadNim-2e4b6b94e675a7de96fcf2b3e8ed4224dccd5747.tar.gz
Revert "fix #16185 (#16195)" (#16197)
This reverts commit bb4b27a2ca414f06fbb9d14ff76fa02a088ac141.
Diffstat (limited to 'tests')
-rw-r--r--tests/arc/t14383.nim51
1 files changed, 1 insertions, 50 deletions
diff --git a/tests/arc/t14383.nim b/tests/arc/t14383.nim
index 0ce7b7d10..85f90d1c8 100644
--- a/tests/arc/t14383.nim
+++ b/tests/arc/t14383.nim
@@ -125,53 +125,4 @@ proc main =
   let rankdef = avals
   echo avals.len, " ", rankdef.len
 
-main()
-
-
-
-
-#------------------------------------------------------------------------------
-# Issue #16185, complex self-assingment elimination
-#------------------------------------------------------------------------------
-
-type
-  CpuStorage*[T] = ref CpuStorageObj[T]
-  CpuStorageObj[T] = object
-    size*: int
-    raw_buffer*: ptr UncheckedArray[T]
-  Tensor[T] = object
-    buf*: CpuStorage[T]
-  TestObject = object
-    x: Tensor[float]
-
-proc `=destroy`[T](s: var CpuStorageObj[T]) =
-  if s.raw_buffer != nil:
-    s.raw_buffer.deallocShared()
-    s.size = 0
-    s.raw_buffer = nil
-
-proc `=`[T](a: var CpuStorageObj[T]; b: CpuStorageObj[T]) {.error.}
-
-proc allocCpuStorage[T](s: var CpuStorage[T], size: int) =
-  new(s)
-  s.raw_buffer = cast[ptr UncheckedArray[T]](allocShared0(sizeof(T) * size))
-  s.size = size
-
-proc newTensor[T](size: int): Tensor[T] =
-  allocCpuStorage(result.buf, size)
-
-proc `[]`[T](t: Tensor[T], idx: int): T = t.buf.raw_buffer[idx]
-proc `[]=`[T](t: Tensor[T], idx: int, val: T) = t.buf.raw_buffer[idx] = val
-
-proc toTensor[T](s: seq[T]): Tensor[T] =
-  result = newTensor[T](s.len)
-  for i, x in s:
-    result[i] = x
-
-proc main2() =
-  var t: TestObject
-  t.x = toTensor(@[1.0, 2, 3, 4])
-  t.x = t.x  
-  doAssert(t.x.buf != nil) # self-assignment above should be eliminated
-
-main2()
+main()
\ No newline at end of file