summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lib/system/mmdisp.nim4
-rw-r--r--lib/system/strmantle.nim2
-rw-r--r--tests/system/tgogc.nim7
3 files changed, 11 insertions, 2 deletions
diff --git a/lib/system/mmdisp.nim b/lib/system/mmdisp.nim
index a56be3d23..47bb400a7 100644
--- a/lib/system/mmdisp.nim
+++ b/lib/system/mmdisp.nim
@@ -235,6 +235,8 @@ elif defined(gogc):
   proc goSetFinalizer(obj: pointer, f: pointer) {.importc: "set_finalizer", codegenDecl:"$1 $2$3 __asm__ (\"main.Set_finalizer\");\n$1 $2$3", dynlib: goLib.}
   proc writebarrierptr(dest: PPointer, src: pointer) {.importc: "writebarrierptr", codegenDecl:"$1 $2$3 __asm__ (\"main.Atomic_store_pointer\");\n$1 $2$3", dynlib: goLib.}
 
+  proc `$`*(x: uint64): string {.noSideEffect, raises: [].}
+
   proc GC_getStatistics(): string =
     var mstats = goMemStats()
     result = "[GC] total allocated memory: " & $(mstats.total_alloc) & "\n" &
@@ -268,7 +270,7 @@ elif defined(gogc):
     result = goMalloc(size.uint)
 
   proc realloc(p: pointer, newsize: Natural): pointer =
-    raise newException(Exception, "not implemented")
+    doAssert false, "not implemented"
 
   proc dealloc(p: pointer) =
     discard
diff --git a/lib/system/strmantle.nim b/lib/system/strmantle.nim
index 66477923c..a54f7a562 100644
--- a/lib/system/strmantle.nim
+++ b/lib/system/strmantle.nim
@@ -304,7 +304,7 @@ proc nimCharToStr(x: char): string {.compilerRtl.} =
   result = newString(1)
   result[0] = x
 
-proc `$`*(x: uint64): string {.noSideEffect.} =
+proc `$`*(x: uint64): string {.noSideEffect, raises: [].} =
   ## The stringify operator for an unsigned integer argument. Returns `x`
   ## converted to a decimal string.
   if x == 0:
diff --git a/tests/system/tgogc.nim b/tests/system/tgogc.nim
new file mode 100644
index 000000000..fd45bb120
--- /dev/null
+++ b/tests/system/tgogc.nim
@@ -0,0 +1,7 @@
+discard """
+  disabled: "windows"
+  cmd: "nim c --gc:go $file"
+  action: "compile"
+"""
+# bug #11447
+echo "Go GC test"
href='#n161'>161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283