summary refs log blame commit diff stats
path: root/lib/posix/linux.nim
blob: be591e29a68b6b720b9ea059556551f8f2dbb79b (plain) (tree)
1
2

                   























                                                           

                                                                  
{.deadCodeElim:on.}

import posix

const
  CSIGNAL* = 0x000000FF
  CLONE_VM* = 0x00000100
  CLONE_FS* = 0x00000200
  CLONE_FILES* = 0x00000400
  CLONE_SIGHAND* = 0x00000800
  CLONE_PTRACE* = 0x00002000
  CLONE_VFORK* = 0x00004000
  CLONE_PARENT* = 0x00008000
  CLONE_THREAD* = 0x00010000
  CLONE_NEWNS* = 0x00020000
  CLONE_SYSVSEM* = 0x00040000
  CLONE_SETTLS* = 0x00080000
  CLONE_PARENT_SETTID* = 0x00100000
  CLONE_CHILD_CLEARTID* = 0x00200000
  CLONE_DETACHED* = 0x00400000
  CLONE_UNTRACED* = 0x00800000
  CLONE_CHILD_SETTID* = 0x01000000
  CLONE_STOPPED* = 0x02000000

# fn should be of type proc (a2: pointer): void {.cdecl.}
proc clone*(fn: pointer; child_stack: pointer; flags: cint;
            arg: pointer; ptid: ptr TPid; tls: pointer; 
            ctid: ptr TPid): cint {.importc, header: "<sched.h>".}
*/ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
discard """
  cmd: "nim check $options $file"
  action: "reject"
  nimout: '''
tcaseexpr1.nim(33, 10) Error: not all cases are covered; missing: {C}
tcaseexpr1.nim(39, 12) Error: type mismatch: got <string> but expected 'int literal(10)'
'''
"""











# line 20
type
  E = enum A, B, C

proc foo(x: int): auto =
  return case x
    of 1..9: "digit"
    else: "number"

var r = foo(10)

var x = C

var t1 = case x:
  of A: "a"
  of B: "b"

var t2 = case x:
  of A: 10
  of B, C: "23"