[Openmp-commits] [openmp] r326312 - [OMPT] Fix inconsistent testcases

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 28 01:28:51 PST 2018


Author: jprotze
Date: Wed Feb 28 01:28:51 2018
New Revision: 326312

URL: http://llvm.org/viewvc/llvm-project?rev=326312&view=rev
Log:
[OMPT] Fix inconsistent testcases

The main change of this patch is to insert {{.*}} in current_address=[[RETURN_ADDRESS_END]].
This is needed to match any of the alternatively printed addresses.

Additionally, clang-format is applied to the two tests.

Differential Revision: https://reviews.llvm.org/D43115

Modified:
    openmp/trunk/runtime/test/ompt/synchronization/flush.c
    openmp/trunk/runtime/test/ompt/synchronization/master.c

Modified: openmp/trunk/runtime/test/ompt/synchronization/flush.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/synchronization/flush.c?rev=326312&r1=326311&r2=326312&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/synchronization/flush.c (original)
+++ openmp/trunk/runtime/test/ompt/synchronization/flush.c Wed Feb 28 01:28:51 2018
@@ -6,27 +6,25 @@
 #include "callback.h"
 #include <omp.h>
 
-int main()
-{
-  #pragma omp parallel num_threads(2)
+int main() {
+#pragma omp parallel num_threads(2)
   {
     int tid = omp_get_thread_num();
-    
-    #pragma omp flush
+
+#pragma omp flush
     print_current_address(1);
   }
 
-  // Check if libomp supports the callbacks for this test.
-  // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_flush'
-
-  // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
-  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_flush: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
-  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: current_address=[[RETURN_ADDRESS]]
-  //
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_flush: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
-  // CHECK: {{^}}[[THREAD_ID:[0-9]+]]: current_address=[[RETURN_ADDRESS]]
-
-
-
   return 0;
 }
+// Check if libomp supports the callbacks for this test.
+// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_flush'
+
+// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
+// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_flush:
+// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
+// CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]
+//
+// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_flush:
+// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]
+// CHECK: {{^}}[[THREAD_ID]]: current_address={{.*}}[[RETURN_ADDRESS]]

Modified: openmp/trunk/runtime/test/ompt/synchronization/master.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/test/ompt/synchronization/master.c?rev=326312&r1=326311&r2=326312&view=diff
==============================================================================
--- openmp/trunk/runtime/test/ompt/synchronization/master.c (original)
+++ openmp/trunk/runtime/test/ompt/synchronization/master.c Wed Feb 28 01:28:51 2018
@@ -6,12 +6,11 @@
 #include "callback.h"
 #include <omp.h>
 
-int main()
-{
+int main() {
   int x = 0;
-  #pragma omp parallel num_threads(2)
+#pragma omp parallel num_threads(2)
   {
-    #pragma omp master
+#pragma omp master
     {
       print_fuzzy_address(1);
       x++;
@@ -21,16 +20,19 @@ int main()
 
   printf("%" PRIu64 ": x=%d\n", ompt_get_thread_data()->value, x);
 
-  // Check if libomp supports the callbacks for this test.
-  // CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_master'
-
-  // CHECK: 0: NULL_POINTER=[[NULL:.*$]]
+  return 0;
+}
 
-  // CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_master_begin: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]], codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
-  // CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]]
-  // CHECK: {{^}}[[MASTER_ID]]: ompt_event_master_end: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]], codeptr_ra=[[RETURN_ADDRESS_END:0x[0-f]+]]
-  // CHECK: {{^}}[[MASTER_ID]]: current_address=[[RETURN_ADDRESS_END]]
+// Check if libomp supports the callbacks for this test.
+// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_master'
 
+// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
 
-  return 0;
-}
+// CHECK: {{^}}[[MASTER_ID:[0-9]+]]: ompt_event_master_begin:
+// CHECK-SAME: parallel_id=[[PARALLEL_ID:[0-9]+]], task_id=[[TASK_ID:[0-9]+]],
+// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS:0x[0-f]+]]{{[0-f][0-f]}}
+// CHECK: {{^}}[[MASTER_ID]]: fuzzy_address={{.*}}[[RETURN_ADDRESS]]
+// CHECK: {{^}}[[MASTER_ID]]: ompt_event_master_end:
+// CHECK-SAME: parallel_id=[[PARALLEL_ID]], task_id=[[TASK_ID]],
+// CHECK-SAME: codeptr_ra=[[RETURN_ADDRESS_END:0x[0-f]+]]
+// CHECK: {{^}}[[MASTER_ID]]: current_address={{.*}}[[RETURN_ADDRESS_END]]




More information about the Openmp-commits mailing list