Skip to content

Commit 8e50c89

Browse files
[OpenMP][Test][NFC] prevent clang-format from breaking FileCheck tests
specify clang-format off and on respectively around FileCheck lines
1 parent 6c2f0d5 commit 8e50c89

File tree

105 files changed

+357
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+357
-21
lines changed

openmp/runtime/test/ompt/cancel/cancel_parallel.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// clang-format off
12
// RUN: %libomp-compile && env OMP_CANCELLATION=true %libomp-run | %sort-threads | FileCheck %s
23
// REQUIRES: ompt
34
// Current GOMP interface implementation does not support cancellation
45
// XFAIL: gcc
6+
// clang-format on
57

68
#include "callback.h"
79
#include "omp.h"
@@ -23,6 +25,7 @@ int main() {
2325
}
2426
}
2527

28+
// clang-format off
2629
// Check if libomp supports the callbacks for this test.
2730
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'
2831
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_cancel'
@@ -35,6 +38,7 @@ int main() {
3538
// CHECK: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_implicit_task_begin
3639
// CHECK-DAG: {{^}}[[THREAD_ID]]: ompt_event_cancel: task_id=[[TASK_ID:[0-f]+]], flags=ompt_cancel_parallel|ompt_cancel_detected=33, codeptr_ra=[[OTHER_RETURN_ADDRESS:(0x)?[0-f]+]]{{[0-f][0-f]}}
3740
// CHECK-DAG: {{^}}[[THREAD_ID]]: fuzzy_address={{.*}}[[OTHER_RETURN_ADDRESS]]
41+
// clang-format on
3842

3943
return 0;
4044
}

openmp/runtime/test/ompt/cancel/cancel_taskgroup.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
// clang-format off
12
// RUN: %libomp-compile && env OMP_CANCELLATION=true %libomp-run | %sort-threads | FileCheck %s
23
// REQUIRES: ompt
34
// UNSUPPORTED: clang-3, clang-4.0.0
45
// Current GOMP interface implementation does not support cancellation; icc 16 has a bug
56
// XFAIL: gcc, icc-16
7+
// clang-format on
68

79
#include "callback.h"
810
#include <unistd.h>
@@ -58,6 +60,7 @@ int main()
5860
#pragma omp barrier
5961
}
6062

63+
// clang-format off
6164
// Check if libomp supports the callbacks for this test.
6265
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_masked'
6366
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_task_create'
@@ -85,6 +88,7 @@ int main()
8588

8689
// CHECK-DAG: {{^}}[[THREAD_ID:[0-9]+]]: ompt_event_thread_begin: thread_type=ompt_thread_worker=2, thread_id=[[THREAD_ID]]
8790
// CHECK-DAG: {{^}}[[THREAD_ID]]: ompt_event_cancel: task_id={{[0-f]+}}, flags=ompt_cancel_taskgroup|ompt_cancel_detected=40, codeptr_ra={{(0x)?[0-f]*}}
91+
// clang-format on
8892

8993
return 0;
9094
}

openmp/runtime/test/ompt/cancel/cancel_worksharing.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// clang-format off
12
// RUN: %libomp-compile && env OMP_CANCELLATION=true %libomp-run | %sort-threads | FileCheck %s
23
// REQUIRES: ompt
34
// Current GOMP interface implementation does not support cancellation; icc 16 does not distinguish between sections and loops
45
// XFAIL: icc-16
6+
// clang-format on
57

68
#include "callback.h"
79
#include <unistd.h>
@@ -49,7 +51,7 @@ int main()
4951
}
5052
}
5153

52-
54+
// clang-format off
5355
// Check if libomp supports the callbacks for this test.
5456
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_implicit_task'
5557
// CHECK-NOT: {{^}}0: Could not register callback 'ompt_callback_cancel'
@@ -62,6 +64,7 @@ int main()
6264
// CHECK: {{^}}[[MASTER_ID]]: ompt_event_cancel: task_id=[[TASK_ID:[0-f]+]], flags=ompt_cancel_sections|ompt_cancel_{{activated=18|detected=34}}, codeptr_ra={{(0x)?[0-f]*}}
6365
// CHECK: {{^}}[[OTHER_THREAD_ID:[0-9]+]]: ompt_event_cancel: task_id=[[TASK_ID:[0-f]+]], flags=ompt_cancel_loop|ompt_cancel_detected=36, codeptr_ra={{(0x)?[0-f]*}}
6466
// CHECK: {{^}}[[OTHER_THREAD_ID:[0-9]+]]: ompt_event_cancel: task_id=[[TASK_ID:[0-f]+]], flags=ompt_cancel_sections|ompt_cancel_{{activated=18|detected=34}}, codeptr_ra={{(0x)?[0-f]*}}
67+
// clang-format on
6568

6669
return 0;
6770
}

openmp/runtime/test/ompt/loadtool/tool_available.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// clang-format off
12
// The OpenMP standard defines 3 ways of providing ompt_start_tool:
23

34
// RUN: mkdir -p %t.tool_dir
@@ -74,6 +75,7 @@
7475

7576

7677
// REQUIRES: ompt
78+
// clang-format on
7779

7880
/*
7981
* This file contains code for an OMPT shared library tool to be
@@ -82,6 +84,7 @@
8284
* -DCODE enables the code for the executable during compilation
8385
*/
8486

87+
// clang-format off
8588
// Check if libomp supports the callbacks for this test.
8689
// CHECK-NOT: {{^}}0: Could not register callback
8790

@@ -99,6 +102,7 @@
99102
// TOOLLIB-SAME: [[PARENTPATH]]/tool.so... Success.
100103
// TOOLLIB-NEXT: Tool was started and is using the OMPT interface.
101104
// TOOLLIB-NEXT: ----- END LOGGING OF TOOL REGISTRATION -----
105+
// clang-format on
102106

103107
#ifdef CODE
104108
#include "omp.h"
@@ -109,11 +113,13 @@ int main()
109113
{
110114
}
111115

116+
// clang-format off
112117
// CHECK-NOT: ----- START LOGGING OF TOOL REGISTRATION -----
113118
// CHECK-NOT: ----- END LOGGING OF TOOL REGISTRATION -----
114119

115120
// CHECK: {{^}}0: NULL_POINTER=[[NULL:.*$]]
116121
// CHECK: {{^}}0: ompt_event_runtime_shutdown
122+
// clang-format on
117123

118124
return 0;
119125
}

openmp/runtime/test/ompt/loadtool/tool_available_search.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// clang-format off
12
// RUN: mkdir -p %t.tool_dir
23
// RUN: %clang %flags -shared -fPIC %s -o %t.tool_dir/first_tool.so
34
// RUN: %clang %flags -DTOOL -DSECOND_TOOL -shared -fPIC %s -o %t.tool_dir/second_tool.so
@@ -8,6 +9,7 @@
89

910
// REQUIRES: ompt
1011
// XFAIL: darwin
12+
// clang-format on
1113

1214
/*
1315
* This file contains code for three OMPT shared library tool to be
@@ -19,6 +21,7 @@
1921
* -DCODE enables the code for the executable during compilation
2022
*/
2123

24+
// clang-format off
2225
// CHECK: ----- START LOGGING OF TOOL REGISTRATION -----
2326
// CHECK-NEXT: Search for OMP tool in current address space... Failed.
2427
// CHECK-NEXT: Searching tool libraries...
@@ -53,7 +56,7 @@
5356
// CHECK-DAG: {{^}}0: ompt_event_thread_begin
5457
// CHECK-DAG: {{^}}0: control_tool()=-1
5558
// CHECK: {{^}}0: Tool finalized
56-
59+
// clang-format on
5760

5861
#ifdef CODE
5962
#include "stdio.h"

openmp/runtime/test/ompt/loadtool/tool_not_available.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// clang-format off
12
// The OpenMP standard defines 3 ways of providing ompt_start_tool:
23

34
// RUN: mkdir -p %t.tool_dir
@@ -44,6 +45,7 @@
4445
// RUN: FileCheck %s -DPARENTPATH=%t.tool_dir --check-prefixes CHECK,TOOLLIB
4546

4647
// REQUIRES: ompt
48+
// clang-format on
4749

4850
/*
4951
* This file contains code for an OMPT shared library tool to be
@@ -68,7 +70,7 @@ int main()
6870
}
6971
}
7072

71-
73+
// clang-format off
7274
// Check if libomp supports the callbacks for this test.
7375
// CHECK-NOT: {{^}}0: Could not register callback
7476

@@ -98,7 +100,7 @@ int main()
98100
// TOOLLIB-NEXT: ----- END LOGGING OF TOOL REGISTRATION -----
99101

100102
// CHECK: {{^}}0: control_tool()=-2
101-
103+
// clang-format on
102104

103105
return 0;
104106
}

openmp/runtime/test/ompt/misc/api_calls_from_other_thread.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
// clang-format off
12
// RUN: %libomp-cxx-compile-and-run | FileCheck %s
23
// REQUIRES: ompt, linux
4+
// clang-format on
35

46
#include <thread>
57
#include "callback.h"
@@ -58,6 +60,7 @@ int main() {
5860
std::thread t1(f);
5961
t1.join();
6062

63+
// clang-format off
6164
// Check if libomp supports the callbacks for this test.
6265

6366
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
@@ -87,6 +90,7 @@ int main() {
8790
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_parallel_info()=0
8891

8992
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_task_info()=0
93+
// clang-format on
9094

9195
return 0;
9296
}

openmp/runtime/test/ompt/misc/api_calls_misc.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
// clang-format off
12
// RUN: %libomp-compile && %libomp-run | FileCheck %s
23
// REQUIRES: ompt
4+
// clang-format on
35
#include "callback.h"
46
#include <omp.h>
57

@@ -52,6 +54,7 @@ int main() {
5254
}
5355
}
5456

57+
// clang-format off
5558
// Check if libomp supports the callbacks for this test.
5659

5760
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
@@ -67,6 +70,7 @@ int main() {
6770

6871
// CHECK-NOT: {{^}}[[THREAD_ID]]: impl_name is NULL
6972
// CHECK-NOT: {{^}}[[THREAD_ID]]: mutex_impls enumeration did not end
73+
// clang-format on
7074

7175
return 0;
7276
}

openmp/runtime/test/ompt/misc/api_calls_places.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
// clang-format off
12
// RUN: %libomp-compile && env OMP_PLACES=cores %libomp-run | FileCheck %s
23
// REQUIRES: ompt, linux
4+
// clang-format on
35
#include "callback.h"
46
#include <omp.h>
57
#define __USE_GNU
@@ -58,6 +60,7 @@ int main() {
5860
ompt_get_thread_data()->value, ompt_get_num_procs());
5961
}
6062

63+
// clang-format off
6164
// Check if libomp supports the callbacks for this test.
6265

6366
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
@@ -83,6 +86,7 @@ int main() {
8386

8487
// CHECK: {{^}}[[MASTER_ID]]: omp_get_num_procs()=[[NUM_PROCS:[-]?[0-9]+]]
8588
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_num_procs()=[[NUM_PROCS]]
89+
// clang-format on
8690

8791
return 0;
8892
}

openmp/runtime/test/ompt/misc/api_calls_without_ompt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
// clang-format off
12
// RUN: %libomp-compile-and-run | FileCheck %s
23
// REQUIRES: ompt
4+
// clang-format on
35

46
#define _BSD_SOURCE
57
#define _DEFAULT_SOURCE
@@ -76,6 +78,7 @@ int main() {
7678
printf("%" PRIu64 ": ompt_get_task_info()=%d\n", tvalue,
7779
ompt_get_task_info(0, NULL, NULL, NULL, NULL, NULL));
7880

81+
// clang-format off
7982
// Check if libomp supports the callbacks for this test.
8083

8184
// CHECK: 0: NULL_POINTER=[[NULL:.*$]]
@@ -105,6 +108,7 @@ int main() {
105108
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_parallel_info()=0
106109

107110
// CHECK: {{^}}[[MASTER_ID]]: ompt_get_task_info()=0
111+
// clang-format on
108112

109113
return 0;
110114
}

0 commit comments

Comments
 (0)