?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. ; various -W<warning_id> combinations (hopefully all of them, if possible)
  2.  
  3. ; the default is "enabled" for all warnings - exercise all of them
  4. abs:    ld hl,@abs ; placeholder for removed `ld hl,abs` (-Wabs removed in v1.20.0)
  5.     DEVICE ZXSPECTRUMNEXT, $8000
  6.     DEVICE NOSLOT64K, $8000
  7.     DEVICE ZXSPECTRUM48, $8000 : DEVICE ZXSPECTRUM48, $8001
  8.     DISP 123 : ORG 345 : ENT
  9.     ORG 123, 0
  10.  
  11.     IF fwd_ref_label : ENDIF    ; it's W_EARLY warning, emitted before last pass, look at start of listing
  12.  
  13.     lua pass3
  14.         _pc("nop")
  15.     endlua
  16.  
  17.     DEVICE ZXSPECTRUMNEXT : ORG $8000 : ret : SAVENEX OPEN "various_W.nex", $8000, $8002 : SAVENEX CLOSE
  18.     ; omitting "nexbmppal" test because it requires too many prerequisites (has dedicated tests any way)
  19.     ; omitting "sna48" and "sna128" tests (have dedicated test any way)
  20.     ; omitting "trdext", "trdext3", "trdextb" and "trddup" tests (have dedicated test)
  21.     RELOCATE_START : ALIGN 2 : RELOCATE_END
  22.     ld  a,(255)
  23.     ; omitting "reldiverts" and "relunstable" test (relocation has many dedicated+updated tests)
  24.     ; omitting "dispmempage" test (has dedicated test (non-trivial))
  25.     SETBREAKPOINT
  26.     out (c),0
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.     ORG 0       ; start again at zero offset
  44. ; disable/enable specific warning and test specific-suppression in eol comment
  45.  
  46.     ; abs
  47.     ; placeholder for removed -Wabs test to minimize diff
  48.     ld hl,@abs
  49.  
  50.     ld hl,@abs
  51.     ld hl,@abs
  52.  
  53.     ; impossible to re-test zxnramtop and noslotramtop, because they are emitted just once
  54.  
  55.     ; devramtop
  56.     OPT -Wno-devramtop
  57.     DEVICE ZXSPECTRUM48, $8002
  58.     OPT -Wdevramtop
  59.     DEVICE ZXSPECTRUM48, $8003  ; luamc-ok - some other id, should not suppress devramtop
  60.     DEVICE ZXSPECTRUM48, $8004  ; but devramtop-ok should suppress it
  61.  
  62.     ; displacedorg
  63.     DISP 101
  64.     OPT -Wno-displacedorg
  65.     ORG 201
  66.     OPT -Wdisplacedorg
  67.     ORG 202     ; luamc-ok - some other id, should not suppress displacedorg
  68.     ORG 203     ; but displacedorg-ok should suppress it
  69.     ENT
  70.  
  71.     ; orgpage
  72.     OPT -Wno-orgpage
  73.     ORG 123, 0
  74.     OPT -Worgpage
  75.     ORG 123, 0  ; luamc-ok - some other id, should not suppress orgpage
  76.     ORG 123, 0  ; but orgpage-ok should suppress it
  77.  
  78.     ; fwdref
  79.     OPT -Wno-fwdref
  80.     IF fwd_ref_label
  81.     ENDIF
  82.     OPT -Wfwdref
  83.     IF fwd_ref_label    ; luamc-ok - some other id, should not suppress fwdref
  84.     ENDIF
  85.     IF fwd_ref_label    ; but fwdref-ok should suppress it
  86.     ENDIF
  87.  
  88.     ; luamc
  89.     OPT -Wno-luamc
  90.     lua pass3
  91.         _pc("nop")
  92.     endlua
  93.     OPT -Wluamc
  94.     lua pass3   ; devramtop-ok - some other id, should not suppress luamc
  95.         _pc("nop")
  96.     endlua
  97.     lua pass3   ; but luamc-ok should suppress it
  98.         _pc("nop")
  99.     endlua
  100.     lua pass3
  101.         _pc("nop")
  102.     endlua      ; but luamc-ok should suppress it (also at "endlua" line)
  103.  
  104.     ; nexstack
  105.     DEVICE ZXSPECTRUMNEXT
  106.     OPT -Wno-nexstack
  107.     SAVENEX OPEN "various_W.nex", $8000, $8002
  108.     SAVENEX CLOSE
  109.     OPT -Wnexstack
  110.     SAVENEX OPEN "various_W.nex", $8000, $8002  ; devramtop-ok - some other id, should not suppress nexstack
  111.     SAVENEX CLOSE
  112.     SAVENEX OPEN "various_W.nex", $8000, $8002  ; but nexstack-ok should suppress it
  113.     SAVENEX CLOSE
  114.  
  115.     ; relalign
  116.     RELOCATE_START
  117.     OPT -Wno-relalign
  118.     ALIGN 2
  119.     OPT -Wrelalign
  120.     ALIGN 4     ; devramtop-ok - some other id, should not suppress relalign
  121.     ALIGN 8     ; but relalign-ok should suppress it
  122.     RELOCATE_END
  123.  
  124.     ; rdlow
  125.     OPT -Wno-rdlow
  126.     ld  a,(255)
  127.     OPT -Wrdlow
  128.     ld  a,(255)  ; devramtop-ok - some other id, should not suppress rdlow
  129.     ld  a,(255)  ; but rdlow-ok should suppress it
  130.  
  131.     ; bpfile
  132.     OPT -Wno-bpfile
  133.     SETBREAKPOINT
  134.     OPT -Wbpfile
  135.     SETBREAKPOINT   ; devramtop-ok - some other id, should not suppress bpfile
  136.     SETBREAKPOINT   ; but bpfile-ok should suppress it
  137.  
  138.     ; out0
  139.     OPT -Wno-out0
  140.     out (c),0
  141.     OPT -Wout0
  142.     out (c),0   ; devramtop-ok - some other id, should not suppress out0
  143.     out (c),0   ; but out0-ok should suppress it
  144.  
  145. ; testing corner-case states possible with the -W option (test coverage)
  146.     OPT -W -Wnon-existent-warning-id-to-cause-warning
  147. fwd_ref_label:  EQU $1234
  148.