Advertisement
agentzh

Untitled

Aug 31st, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 21.93 KB | None | 0 0
  1. diff --git a/testsuite/systemtap.base/return_no_val.exp b/testsuite/systemtap.base/return_no_val.exp
  2. index d3533712d..4c61cce6a 100644
  3. --- a/testsuite/systemtap.base/return_no_val.exp
  4. +++ b/testsuite/systemtap.base/return_no_val.exp
  5. @@ -393,3 +393,513 @@ if {$failed} {
  6.  if {$stderr ne ""} {
  7.      send_log "stderr:\n$stderr"
  8.  }
  9. +
  10. +# --- TEST 10 ---
  11. +
  12. +set subtest10 "TEST 10: 'return' right before 'if'"
  13. +foreach runtime [get_runtime_list] {
  14. +    if {$runtime eq ""} {
  15. +        set runtime "kernel"
  16. +    }
  17. +    set test_name "$test: $subtest10 ($runtime)"
  18. +
  19. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_10.stp'"
  20. +    send_log "executing: $cmd\n"
  21. +    set pipe [open "| sh -c {$cmd}" r]
  22. +    set out [read $pipe]
  23. +    set failed 0
  24. +    if {[catch {close $pipe} stderr] != 0} {
  25. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  26. +            append stderr "\n"
  27. +        }
  28. +        global errorCode
  29. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  30. +            set failed [lindex $errorCode 2]
  31. +        }
  32. +    }
  33. +
  34. +    set exp_out ""
  35. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  36. +    if {$out eq $exp_out} {
  37. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  38. +    } else {
  39. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  40. +    }
  41. +
  42. +    if {$failed} {
  43. +        pass "${test_name}: exit code should be non-zero"
  44. +    } else {
  45. +        fail "${test_name}: exit code should be non-zero but is zero"
  46. +    }
  47. +
  48. +    set stderr_pat "^parse error: expected literal string or number
  49. +        saw: keyword at \[^\\n\]*?\\.stp:4:5
  50. +     source:     if \\(1\\) \\\{
  51. +                 \\^
  52. +"
  53. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  54. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  55. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  56. +    } else {
  57. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  58. +    }
  59. +}
  60. +
  61. +# --- TEST 11 ---
  62. +
  63. +set subtest11 "TEST 11: 'return' right before 'for'"
  64. +foreach runtime [get_runtime_list] {
  65. +    if {$runtime eq ""} {
  66. +        set runtime "kernel"
  67. +    }
  68. +    set test_name "$test: $subtest11 ($runtime)"
  69. +
  70. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_11.stp'"
  71. +    send_log "executing: $cmd\n"
  72. +    set pipe [open "| sh -c {$cmd}" r]
  73. +    set out [read $pipe]
  74. +    set failed 0
  75. +    if {[catch {close $pipe} stderr] != 0} {
  76. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  77. +            append stderr "\n"
  78. +        }
  79. +        global errorCode
  80. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  81. +            set failed [lindex $errorCode 2]
  82. +        }
  83. +    }
  84. +
  85. +    set exp_out ""
  86. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  87. +    if {$out eq $exp_out} {
  88. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  89. +    } else {
  90. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  91. +    }
  92. +
  93. +    if {$failed} {
  94. +        pass "${test_name}: exit code should be non-zero"
  95. +    } else {
  96. +        fail "${test_name}: exit code should be non-zero but is zero"
  97. +    }
  98. +
  99. +    set stderr_pat "^parse error: expected literal string or number
  100. +        saw: keyword at \[^\\n\]*?\\.stp:4:5
  101. +     source:     for \\(;;\\) \\\{
  102. +                 \\^
  103. +"
  104. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  105. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  106. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  107. +    } else {
  108. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  109. +    }
  110. +}
  111. +
  112. +# --- TEST 12 ---
  113. +
  114. +set subtest12 "TEST 12: 'return' right before 'while'"
  115. +foreach runtime [get_runtime_list] {
  116. +    if {$runtime eq ""} {
  117. +        set runtime "kernel"
  118. +    }
  119. +    set test_name "$test: $subtest12 ($runtime)"
  120. +
  121. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_12.stp'"
  122. +    send_log "executing: $cmd\n"
  123. +    set pipe [open "| sh -c {$cmd}" r]
  124. +    set out [read $pipe]
  125. +    set failed 0
  126. +    if {[catch {close $pipe} stderr] != 0} {
  127. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  128. +            append stderr "\n"
  129. +        }
  130. +        global errorCode
  131. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  132. +            set failed [lindex $errorCode 2]
  133. +        }
  134. +    }
  135. +
  136. +    set exp_out ""
  137. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  138. +    if {$out eq $exp_out} {
  139. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  140. +    } else {
  141. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  142. +    }
  143. +
  144. +    if {$failed} {
  145. +        pass "${test_name}: exit code should be non-zero"
  146. +    } else {
  147. +        fail "${test_name}: exit code should be non-zero but is zero"
  148. +    }
  149. +
  150. +    set stderr_pat "^parse error: expected literal string or number
  151. +        saw: keyword at \[^\\n\]*?\\.stp:4:5
  152. +     source:     while \\(1\\) \\\{
  153. +                 \\^
  154. +"
  155. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  156. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  157. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  158. +    } else {
  159. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  160. +    }
  161. +}
  162. +
  163. +# --- TEST 13 ---
  164. +
  165. +set subtest13 "TEST 13: 'return' right before 'foreach'"
  166. +foreach runtime [get_runtime_list] {
  167. +    if {$runtime eq ""} {
  168. +        set runtime "kernel"
  169. +    }
  170. +    set test_name "$test: $subtest13 ($runtime)"
  171. +
  172. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_13.stp'"
  173. +    send_log "executing: $cmd\n"
  174. +    set pipe [open "| sh -c {$cmd}" r]
  175. +    set out [read $pipe]
  176. +    set failed 0
  177. +    if {[catch {close $pipe} stderr] != 0} {
  178. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  179. +            append stderr "\n"
  180. +        }
  181. +        global errorCode
  182. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  183. +            set failed [lindex $errorCode 2]
  184. +        }
  185. +    }
  186. +
  187. +    set exp_out ""
  188. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  189. +    if {$out eq $exp_out} {
  190. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  191. +    } else {
  192. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  193. +    }
  194. +
  195. +    if {$failed} {
  196. +        pass "${test_name}: exit code should be non-zero"
  197. +    } else {
  198. +        fail "${test_name}: exit code should be non-zero but is zero"
  199. +    }
  200. +
  201. +    set stderr_pat "^parse error: expected literal string or number
  202. +        saw: keyword at \[^\\n\]*?\\.stp:6:5
  203. +     source:     foreach \\(k in a\\) \\\{
  204. +                 \\^
  205. +"
  206. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  207. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  208. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  209. +    } else {
  210. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  211. +    }
  212. +}
  213. +
  214. +# --- TEST 14 ---
  215. +
  216. +set subtest14 "TEST 14: 'return' right before 'return'"
  217. +foreach runtime [get_runtime_list] {
  218. +    if {$runtime eq ""} {
  219. +        set runtime "kernel"
  220. +    }
  221. +    set test_name "$test: $subtest14 ($runtime)"
  222. +
  223. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_14.stp'"
  224. +    send_log "executing: $cmd\n"
  225. +    set pipe [open "| sh -c {$cmd}" r]
  226. +    set out [read $pipe]
  227. +    set failed 0
  228. +    if {[catch {close $pipe} stderr] != 0} {
  229. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  230. +            append stderr "\n"
  231. +        }
  232. +        global errorCode
  233. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  234. +            set failed [lindex $errorCode 2]
  235. +        }
  236. +    }
  237. +
  238. +    set exp_out ""
  239. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  240. +    if {$out eq $exp_out} {
  241. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  242. +    } else {
  243. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  244. +    }
  245. +
  246. +    if {$failed} {
  247. +        pass "${test_name}: exit code should be non-zero"
  248. +    } else {
  249. +        fail "${test_name}: exit code should be non-zero but is zero"
  250. +    }
  251. +
  252. +    set stderr_pat "^parse error: expected literal string or number
  253. +        saw: keyword at \[^\\n\]*?\\.stp:4:5
  254. +     source:     return
  255. +                 \\^
  256. +"
  257. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  258. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  259. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  260. +    } else {
  261. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  262. +    }
  263. +}
  264. +
  265. +# --- TEST 15 ---
  266. +
  267. +set subtest15 "TEST 15: 'return' right before 'next'"
  268. +foreach runtime [get_runtime_list] {
  269. +    if {$runtime eq ""} {
  270. +        set runtime "kernel"
  271. +    }
  272. +    set test_name "$test: $subtest15 ($runtime)"
  273. +
  274. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_15.stp'"
  275. +    send_log "executing: $cmd\n"
  276. +    set pipe [open "| sh -c {$cmd}" r]
  277. +    set out [read $pipe]
  278. +    set failed 0
  279. +    if {[catch {close $pipe} stderr] != 0} {
  280. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  281. +            append stderr "\n"
  282. +        }
  283. +        global errorCode
  284. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  285. +            set failed [lindex $errorCode 2]
  286. +        }
  287. +    }
  288. +
  289. +    set exp_out ""
  290. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  291. +    if {$out eq $exp_out} {
  292. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  293. +    } else {
  294. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  295. +    }
  296. +
  297. +    if {$failed} {
  298. +        pass "${test_name}: exit code should be non-zero"
  299. +    } else {
  300. +        fail "${test_name}: exit code should be non-zero but is zero"
  301. +    }
  302. +
  303. +    set stderr_pat "^parse error: expected literal string or number
  304. +        saw: keyword at \[^\\n\]*?\\.stp:4:5
  305. +     source:     next
  306. +                 \\^
  307. +"
  308. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  309. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  310. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  311. +    } else {
  312. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  313. +    }
  314. +}
  315. +
  316. +# --- TEST 16 ---
  317. +
  318. +set subtest16 "TEST 16: 'return' right before 'delete'"
  319. +foreach runtime [get_runtime_list] {
  320. +    if {$runtime eq ""} {
  321. +        set runtime "kernel"
  322. +    }
  323. +    set test_name "$test: $subtest16 ($runtime)"
  324. +
  325. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_16.stp'"
  326. +    send_log "executing: $cmd\n"
  327. +    set pipe [open "| sh -c {$cmd}" r]
  328. +    set out [read $pipe]
  329. +    set failed 0
  330. +    if {[catch {close $pipe} stderr] != 0} {
  331. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  332. +            append stderr "\n"
  333. +        }
  334. +        global errorCode
  335. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  336. +            set failed [lindex $errorCode 2]
  337. +        }
  338. +    }
  339. +
  340. +    set exp_out ""
  341. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  342. +    if {$out eq $exp_out} {
  343. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  344. +    } else {
  345. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  346. +    }
  347. +
  348. +    if {$failed} {
  349. +        pass "${test_name}: exit code should be non-zero"
  350. +    } else {
  351. +        fail "${test_name}: exit code should be non-zero but is zero"
  352. +    }
  353. +
  354. +    set stderr_pat "^parse error: expected literal string or number
  355. +        saw: keyword at \[^\\n\]*?\\.stp:6:5
  356. +     source:     delete a
  357. +                 \\^
  358. +"
  359. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  360. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  361. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  362. +    } else {
  363. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  364. +    }
  365. +}
  366. +
  367. +# --- TEST 17 ---
  368. +
  369. +set subtest17 "TEST 17: 'return' right before 'try'"
  370. +foreach runtime [get_runtime_list] {
  371. +    if {$runtime eq ""} {
  372. +        set runtime "kernel"
  373. +    }
  374. +    set test_name "$test: $subtest17 ($runtime)"
  375. +
  376. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_17.stp'"
  377. +    send_log "executing: $cmd\n"
  378. +    set pipe [open "| sh -c {$cmd}" r]
  379. +    set out [read $pipe]
  380. +    set failed 0
  381. +    if {[catch {close $pipe} stderr] != 0} {
  382. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  383. +            append stderr "\n"
  384. +        }
  385. +        global errorCode
  386. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  387. +            set failed [lindex $errorCode 2]
  388. +        }
  389. +    }
  390. +
  391. +    set exp_out ""
  392. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  393. +    if {$out eq $exp_out} {
  394. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  395. +    } else {
  396. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  397. +    }
  398. +
  399. +    if {$failed} {
  400. +        pass "${test_name}: exit code should be non-zero"
  401. +    } else {
  402. +        fail "${test_name}: exit code should be non-zero but is zero"
  403. +    }
  404. +
  405. +    set stderr_pat "^parse error: expected literal string or number
  406. +        saw: keyword at \[^\\n\]*?\\.stp:6:5
  407. +     source:     try \\\{
  408. +                 \\^
  409. +"
  410. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  411. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  412. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  413. +    } else {
  414. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  415. +    }
  416. +}
  417. +
  418. +# --- TEST 18 ---
  419. +
  420. +set subtest18 "TEST 18: 'return' right before 'break'"
  421. +foreach runtime [get_runtime_list] {
  422. +    if {$runtime eq ""} {
  423. +        set runtime "kernel"
  424. +    }
  425. +    set test_name "$test: $subtest18 ($runtime)"
  426. +
  427. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_18.stp'"
  428. +    send_log "executing: $cmd\n"
  429. +    set pipe [open "| sh -c {$cmd}" r]
  430. +    set out [read $pipe]
  431. +    set failed 0
  432. +    if {[catch {close $pipe} stderr] != 0} {
  433. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  434. +            append stderr "\n"
  435. +        }
  436. +        global errorCode
  437. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  438. +            set failed [lindex $errorCode 2]
  439. +        }
  440. +    }
  441. +
  442. +    set exp_out ""
  443. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  444. +    if {$out eq $exp_out} {
  445. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  446. +    } else {
  447. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  448. +    }
  449. +
  450. +    if {$failed} {
  451. +        pass "${test_name}: exit code should be non-zero"
  452. +    } else {
  453. +        fail "${test_name}: exit code should be non-zero but is zero"
  454. +    }
  455. +
  456. +    set stderr_pat "^parse error: expected literal string or number
  457. +        saw: keyword at \[^\\n\]*?\\.stp:5:9
  458. +     source:         break
  459. +                     \\^
  460. +"
  461. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  462. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  463. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  464. +    } else {
  465. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  466. +    }
  467. +}
  468. +
  469. +# --- TEST 19 ---
  470. +
  471. +set subtest19 "TEST 19: 'return' right before 'continue'"
  472. +foreach runtime [get_runtime_list] {
  473. +    if {$runtime eq ""} {
  474. +        set runtime "kernel"
  475. +    }
  476. +    set test_name "$test: $subtest19 ($runtime)"
  477. +
  478. +    set cmd "stap --runtime=$runtime '$srcdir/$subdir/${test}_19.stp'"
  479. +    send_log "executing: $cmd\n"
  480. +    set pipe [open "| sh -c {$cmd}" r]
  481. +    set out [read $pipe]
  482. +    set failed 0
  483. +    if {[catch {close $pipe} stderr] != 0} {
  484. +        if {$stderr ne "" && [string index $stderr end] ne "\n"} {
  485. +            append stderr "\n"
  486. +        }
  487. +        global errorCode
  488. +        if {"CHILDSTATUS" == [lindex $errorCode 0]} {
  489. +            set failed [lindex $errorCode 2]
  490. +        }
  491. +    }
  492. +
  493. +    set exp_out ""
  494. +    regsub -all -- {\n} $exp_out {\n} escaped_exp_out
  495. +    if {$out eq $exp_out} {
  496. +        pass "${test_name}: stdout matches \"$escaped_exp_out\""
  497. +    } else {
  498. +        fail "${test_name}: stdout fails to match \"$escaped_exp_out\": got \"$out\""
  499. +    }
  500. +
  501. +    if {$failed} {
  502. +        pass "${test_name}: exit code should be non-zero"
  503. +    } else {
  504. +        fail "${test_name}: exit code should be non-zero but is zero"
  505. +    }
  506. +
  507. +    set stderr_pat "^parse error: expected literal string or number
  508. +        saw: keyword at \[^\\n\]*?\\.stp:5:9
  509. +     source:         continue
  510. +                     \\^
  511. +"
  512. +    regsub -all -- {\n} $stderr_pat {\n} escaped_stderr_pat
  513. +    if {[regexp -linestop -lineanchor -- $stderr_pat $stderr]} {
  514. +        pass "${test_name}: stderr matches \"$escaped_stderr_pat\""
  515. +    } else {
  516. +        fail "${test_name}: stderr fails to match \"$escaped_stderr_pat\": got \"$stderr\""
  517. +    }
  518. +}
  519. diff --git a/testsuite/systemtap.base/return_no_val_10.stp b/testsuite/systemtap.base/return_no_val_10.stp
  520. index b30ddc126..2f6d42bd0 100644
  521. --- a/testsuite/systemtap.base/return_no_val_10.stp
  522. +++ b/testsuite/systemtap.base/return_no_val_10.stp
  523. @@ -1,7 +1,9 @@
  524.  function f() {
  525.      println("enter f");
  526.      return
  527. -    next
  528. +    if (1) {
  529. +        println("leave f");
  530. +    }
  531.  }
  532.  
  533.  probe oneshot {
  534. diff --git a/testsuite/systemtap.base/return_no_val_11.stp b/testsuite/systemtap.base/return_no_val_11.stp
  535. index 0de8a2c81..1f6529ea8 100644
  536. --- a/testsuite/systemtap.base/return_no_val_11.stp
  537. +++ b/testsuite/systemtap.base/return_no_val_11.stp
  538. @@ -1,12 +1,13 @@
  539. -global a
  540.  function f() {
  541.      println("enter f");
  542. -    a[1] = 3
  543.      return
  544. -    delete a
  545. +    for (;;) {
  546. +        println("leave f");
  547. +        return
  548. +    }
  549.  }
  550.  
  551.  probe oneshot {
  552.      f();
  553. -    printf("a[1] = %d\n", a[1]);
  554. +    printf("exit\n");
  555.  }
  556. diff --git a/testsuite/systemtap.base/return_no_val_12.stp b/testsuite/systemtap.base/return_no_val_12.stp
  557. index 2f28e5df4..4d243bf56 100644
  558. --- a/testsuite/systemtap.base/return_no_val_12.stp
  559. +++ b/testsuite/systemtap.base/return_no_val_12.stp
  560. @@ -1,14 +1,13 @@
  561. -global a
  562.  function f() {
  563.      println("enter f");
  564. -    a[1] = 3
  565.      return
  566. -    try {
  567. -        delete a
  568. -    } catch {}
  569. +    while (1) {
  570. +        println("leave f");
  571. +        return
  572. +    }
  573.  }
  574.  
  575.  probe oneshot {
  576.      f();
  577. -    printf("a[1] = %d\n", a[1]);
  578. +    printf("exit\n");
  579.  }
  580. diff --git a/testsuite/systemtap.base/return_no_val_13.stp b/testsuite/systemtap.base/return_no_val_13.stp
  581. index cd64295c0..6291e0c63 100644
  582. --- a/testsuite/systemtap.base/return_no_val_13.stp
  583. +++ b/testsuite/systemtap.base/return_no_val_13.stp
  584. @@ -1,12 +1,15 @@
  585. +global a
  586.  function f() {
  587. -    while (1) {
  588. -        println("enter f");
  589. +    println("enter f");
  590. +    a[1] = 3
  591. +    return
  592. +    foreach (k in a) {
  593. +        println("k: ", k);
  594.          return
  595. -        break
  596.      }
  597.  }
  598.  
  599.  probe oneshot {
  600.      f();
  601. -    printf("exit\n");
  602. +    printf("a[1] = %d\n", a[1]);
  603.  }
  604. diff --git a/testsuite/systemtap.base/return_no_val_14.stp b/testsuite/systemtap.base/return_no_val_14.stp
  605. index b4a5d942a..b1d33d5c6 100644
  606. --- a/testsuite/systemtap.base/return_no_val_14.stp
  607. +++ b/testsuite/systemtap.base/return_no_val_14.stp
  608. @@ -1,9 +1,7 @@
  609.  function f() {
  610. -    while (1) {
  611. -        println("enter f");
  612. -        return
  613. -        continue
  614. -    }
  615. +    println("enter f");
  616. +    return
  617. +    return
  618.  }
  619.  
  620.  probe oneshot {
  621. diff --git a/testsuite/systemtap.base/return_no_val_15.stp b/testsuite/systemtap.base/return_no_val_15.stp
  622. index 60fb3b622..b30ddc126 100644
  623. --- a/testsuite/systemtap.base/return_no_val_15.stp
  624. +++ b/testsuite/systemtap.base/return_no_val_15.stp
  625. @@ -1,7 +1,10 @@
  626.  function f() {
  627. -    return return
  628. +    println("enter f");
  629. +    return
  630. +    next
  631.  }
  632.  
  633.  probe oneshot {
  634.      f();
  635. +    printf("exit\n");
  636.  }
  637. diff --git a/testsuite/systemtap.base/return_no_val_16.stp b/testsuite/systemtap.base/return_no_val_16.stp
  638. index 3bcfc2d94..0de8a2c81 100644
  639. --- a/testsuite/systemtap.base/return_no_val_16.stp
  640. +++ b/testsuite/systemtap.base/return_no_val_16.stp
  641. @@ -1,10 +1,12 @@
  642. +global a
  643.  function f() {
  644. +    println("enter f");
  645. +    a[1] = 3
  646.      return
  647. -    if (1) {
  648. -        println("leave f");
  649. -    }
  650. +    delete a
  651.  }
  652.  
  653.  probe oneshot {
  654.      f();
  655. +    printf("a[1] = %d\n", a[1]);
  656.  }
  657. diff --git a/testsuite/systemtap.base/return_no_val_17.stp b/testsuite/systemtap.base/return_no_val_17.stp
  658. index 4c2197676..2f28e5df4 100644
  659. --- a/testsuite/systemtap.base/return_no_val_17.stp
  660. +++ b/testsuite/systemtap.base/return_no_val_17.stp
  661. @@ -1,10 +1,14 @@
  662. +global a
  663.  function f() {
  664. -    if (1)
  665. -        return
  666. -    while (1)
  667. -        next
  668. +    println("enter f");
  669. +    a[1] = 3
  670. +    return
  671. +    try {
  672. +        delete a
  673. +    } catch {}
  674.  }
  675.  
  676.  probe oneshot {
  677.      f();
  678. +    printf("a[1] = %d\n", a[1]);
  679.  }
  680. diff --git a/testsuite/systemtap.base/return_no_val_18.stp b/testsuite/systemtap.base/return_no_val_18.stp
  681. index cdd52826b..cd64295c0 100644
  682. --- a/testsuite/systemtap.base/return_no_val_18.stp
  683. +++ b/testsuite/systemtap.base/return_no_val_18.stp
  684. @@ -1,10 +1,12 @@
  685.  function f() {
  686. -    for (;;)
  687. +    while (1) {
  688. +        println("enter f");
  689.          return
  690. -    while (1)
  691. -        next
  692. +        break
  693. +    }
  694.  }
  695.  
  696.  probe oneshot {
  697.      f();
  698. +    printf("exit\n");
  699.  }
  700. diff --git a/testsuite/systemtap.base/return_no_val_19.stp b/testsuite/systemtap.base/return_no_val_19.stp
  701. index 318deeeae..b4a5d942a 100644
  702. --- a/testsuite/systemtap.base/return_no_val_19.stp
  703. +++ b/testsuite/systemtap.base/return_no_val_19.stp
  704. @@ -1,9 +1,12 @@
  705.  function f() {
  706. -    while (1)
  707. +    while (1) {
  708. +        println("enter f");
  709.          return
  710. -    next
  711. +        continue
  712. +    }
  713.  }
  714.  
  715.  probe oneshot {
  716.      f();
  717. +    printf("exit\n");
  718.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement