summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.base/rand.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/systemtap.base/rand.stp')
-rw-r--r--testsuite/systemtap.base/rand.stp19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/systemtap.base/rand.stp b/testsuite/systemtap.base/rand.stp
new file mode 100644
index 00000000..d584e5f7
--- /dev/null
+++ b/testsuite/systemtap.base/rand.stp
@@ -0,0 +1,19 @@
+function checkStatus(status:long){
+ if (status == 1){
+ printf("%s\n","FAIL")
+ }else{
+ printf("%s\n","PASS")
+ }
+}
+
+probe begin
+{
+ status = 0
+ for (i=1; i <= 100; i++){
+ if (randint(i) < 0 || randint(i) > i) {
+ status = 1
+ }
+ }
+ checkStatus(status)
+ exit()
+}