From db5db446d2a7daaedd60f79c86d8919c7669ab9d Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Sun, 1 Apr 2018 23:41:36 +0200 Subject: [PATCH] regression/ck_pr: Add tests for ck_pr_load_ptr() and ck_pr_store_ptr(). --- regressions/ck_pr/validate/ck_pr_load.c | 6 ++++++ regressions/ck_pr/validate/ck_pr_store.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/regressions/ck_pr/validate/ck_pr_load.c b/regressions/ck_pr/validate/ck_pr_load.c index a15acd0..b07a38f 100644 --- a/regressions/ck_pr/validate/ck_pr_load.c +++ b/regressions/ck_pr/validate/ck_pr_load.c @@ -118,6 +118,7 @@ rg_width(int m) int main(void) { + void *ptr = (void *)-1; common_srand((unsigned int)getpid()); @@ -143,6 +144,11 @@ main(void) ck_pr_load_64_2(&b, &a); printf("%" PRIx64 ":%" PRIx64 "\n", a[0], a[1]); #endif + printf("ck_pr_load_ptr: "); + if (ck_pr_load_ptr(&ptr) != (void *)(-1)) + printf("Failed : %p != %p\n", ck_pr_load_ptr(&ptr), (void *)(-1)); + else + printf("SUCCESS\n"); return (0); } diff --git a/regressions/ck_pr/validate/ck_pr_store.c b/regressions/ck_pr/validate/ck_pr_store.c index e4b852b..07e969b 100644 --- a/regressions/ck_pr/validate/ck_pr_store.c +++ b/regressions/ck_pr/validate/ck_pr_store.c @@ -119,6 +119,8 @@ rg_width(int m) int main(void) { + void *ptr; + #if defined(CK_F_PR_STORE_DOUBLE) && defined(CK_F_PR_LOAD_DOUBLE) double d; @@ -145,6 +147,12 @@ main(void) #ifdef CK_F_PR_STORE_8 CK_PR_STORE_B(8); #endif + printf("ck_pr_store_ptr: "); + ck_pr_store_ptr(&ptr, (void *)-1); + if (ptr != (void *)(-1)) + printf("Failed : %p != %p\n", ptr, (void *)-1); + else + printf("SUCCESS\n"); return (0); }