Skip to content

Commit 400564f

Browse files
committed
Fix clang tests
1 parent dfbc24d commit 400564f

11 files changed

+16405
-7045
lines changed

clang/test/AST/ByteCode/openmp.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@ extern int omp_get_thread_num(void);
1717

1818
int test2() {
1919
int x = 0;
20-
int result[N] = {0};
20+
int device_result[N] = {0};
2121

22-
#pragma omp parallel loop num_threads(strict: N) severity(warning) message("msg")
22+
#pragma omp target parallel loop num_threads(strict: N)
2323
for (int i = 0; i < N; i++) {
2424
x = omp_get_thread_num();
25-
result[i] = i + x;
25+
device_result[i] = i + x;
2626
}
2727
}
2828

29-

clang/test/OpenMP/amdgcn_target_parallel_num_threads_codegen.cpp

Lines changed: 1067 additions & 0 deletions
Large diffs are not rendered by default.

clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp

Lines changed: 5803 additions & 5676 deletions
Large diffs are not rendered by default.

clang/test/OpenMP/distribute_parallel_for_simd_num_threads_strict_codegen.cpp

Lines changed: 3417 additions & 0 deletions
Large diffs are not rendered by default.

clang/test/OpenMP/nvptx_parallel_num_threads_strict_messages.cpp

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,23 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6
12
// RUN: %clang_cc1 -DF1 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host-ppc.bc
2-
// RUN: %clang_cc1 -DF1 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
3+
// RUN: %clang_cc1 -DF1 -verify -fopenmp -fopenmp-version=60 -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
34
// RUN: %clang_cc1 -DF2 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host-ppc.bc
4-
// RUN: %clang_cc1 -DF2 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
5+
// RUN: %clang_cc1 -DF2 -verify -fopenmp -fopenmp-version=60 -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
56
// RUN: %clang_cc1 -DF3 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host-ppc.bc
6-
// RUN: %clang_cc1 -DF3 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
7+
// RUN: %clang_cc1 -DF3 -verify -fopenmp -fopenmp-version=60 -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
78

8-
#ifndef TARGET
99
// expected-no-diagnostics
10-
#endif
1110

1211
#ifdef F3
1312
template<typename tx>
1413
tx ftemplate(int n) {
1514
tx a = 0;
1615

17-
#ifdef TARGET
18-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
19-
#endif
2016
#pragma omp parallel num_threads(strict: tx(20)) severity(fatal) message("msg")
2117
{
2218
}
2319

2420
short b = 1;
25-
#ifdef TARGET
26-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
27-
#endif
2821
#pragma omp parallel num_threads(strict: b) severity(warning) message("msg")
2922
{
3023
a += b;
@@ -38,16 +31,10 @@ tx ftemplate(int n) {
3831
static
3932
int fstatic(int n) {
4033

41-
#ifdef TARGET
42-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
43-
#endif
4434
#pragma omp target parallel num_threads(strict: n) message("msg")
4535
{
4636
}
4737

48-
#ifdef TARGET
49-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
50-
#endif
5138
#pragma omp target parallel num_threads(strict: 32+n) severity(warning)
5239
{
5340
}
@@ -63,17 +50,11 @@ struct S1 {
6350
int r1(int n){
6451
int b = 1;
6552

66-
#ifdef TARGET
67-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
68-
#endif
6953
#pragma omp parallel num_threads(strict: n-b) severity(warning) message("msg")
7054
{
7155
this->a = (double)b + 1.5;
7256
}
7357

74-
#ifdef TARGET
75-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
76-
#endif
7758
#pragma omp parallel num_threads(strict: 1024) severity(fatal)
7859
{
7960
this->a = 2.5;

clang/test/OpenMP/nvptx_target_parallel_num_threads_codegen.cpp

Lines changed: 703 additions & 35 deletions
Large diffs are not rendered by default.

clang/test/OpenMP/target_parallel_generic_loop_codegen.cpp

Lines changed: 383 additions & 18 deletions
Large diffs are not rendered by default.

clang/test/OpenMP/target_parallel_num_threads_strict_codegen.cpp

Lines changed: 1888 additions & 1262 deletions
Large diffs are not rendered by default.

clang/test/OpenMP/target_parallel_num_threads_strict_messages.cpp

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
// RUN: %clang_cc1 -DF1 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-ppc-host-ppc.bc
2-
// RUN: %clang_cc1 -DF1 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
2+
// RUN: %clang_cc1 -DF1 -verify -fopenmp -fopenmp-version=60 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
33
// RUN: %clang_cc1 -DF2 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-ppc-host-ppc.bc
4-
// RUN: %clang_cc1 -DF2 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
4+
// RUN: %clang_cc1 -DF2 -verify -fopenmp -fopenmp-version=60 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
55
// RUN: %clang_cc1 -DF3 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm-bc %s -o %t-ppc-host-ppc.bc
6-
// RUN: %clang_cc1 -DF3 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
6+
// RUN: %clang_cc1 -DF3 -verify -fopenmp -fopenmp-version=60 -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-ppc-host-ppc.bc -o /dev/null
77

88
// RUN: %clang_cc1 -DF1 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=spirv64-intel -emit-llvm-bc %s -o %t-spirv-ppc-host-ppc.bc
9-
// RUN: %clang_cc1 -DF1 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple spirv64-intel -fopenmp-targets=spirv64-intel -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-spirv-ppc-host-ppc.bc -o /dev/null
9+
// RUN: %clang_cc1 -DF1 -verify -fopenmp -fopenmp-version=60 -triple spirv64-intel -fopenmp-targets=spirv64-intel -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-spirv-ppc-host-ppc.bc -o /dev/null
1010
// RUN: %clang_cc1 -DF2 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=spirv64-intel -emit-llvm-bc %s -o %t-spirv-ppc-host-ppc.bc
11-
// RUN: %clang_cc1 -DF2 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple spirv64-intel -fopenmp-targets=spirv64-intel -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-spirv-ppc-host-ppc.bc -o /dev/null
11+
// RUN: %clang_cc1 -DF2 -verify -fopenmp -fopenmp-version=60 -triple spirv64-intel -fopenmp-targets=spirv64-intel -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-spirv-ppc-host-ppc.bc -o /dev/null
1212
// RUN: %clang_cc1 -DF3 -verify -fopenmp -fopenmp-version=60 -triple x86_64-unknown-unknown -fopenmp-targets=spirv64-intel -emit-llvm-bc %s -o %t-spirv-ppc-host-ppc.bc
13-
// RUN: %clang_cc1 -DF3 -DTARGET -verify -fopenmp -fopenmp-version=60 -triple spirv64-intel -fopenmp-targets=spirv64-intel -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-spirv-ppc-host-ppc.bc -o /dev/null
13+
// RUN: %clang_cc1 -DF3 -verify -fopenmp -fopenmp-version=60 -triple spirv64-intel -fopenmp-targets=spirv64-intel -emit-llvm %s -fopenmp-is-target-device -fopenmp-host-ir-file-path %t-spirv-ppc-host-ppc.bc -o /dev/null
1414

15-
#ifndef TARGET
1615
// expected-no-diagnostics
17-
#endif
1816

1917
#ifdef F3
2018
template<typename tx>
2119
tx ftemplate(int n) {
2220
tx a = 0;
2321

24-
#ifdef TARGET
25-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
26-
#endif
2722
#pragma omp parallel num_threads(strict: tx(20)) severity(fatal) message("msg")
2823
{
2924
}
3025

3126
short b = 1;
32-
#ifdef TARGET
33-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
34-
#endif
3527
#pragma omp parallel num_threads(strict: b) severity(warning) message("msg")
3628
{
3729
a += b;
@@ -44,17 +36,10 @@ tx ftemplate(int n) {
4436
#ifdef F2
4537
static
4638
int fstatic(int n) {
47-
48-
#ifdef TARGET
49-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
50-
#endif
5139
#pragma omp target parallel num_threads(strict: n) message("msg")
5240
{
5341
}
5442

55-
#ifdef TARGET
56-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
57-
#endif
5843
#pragma omp target parallel num_threads(strict: 32+n) severity(warning)
5944
{
6045
}
@@ -70,17 +55,11 @@ struct S1 {
7055
int r1(int n){
7156
int b = 1;
7257

73-
#ifdef TARGET
74-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
75-
#endif
7658
#pragma omp parallel num_threads(strict: n-b) severity(warning) message("msg")
7759
{
7860
this->a = (double)b + 1.5;
7961
}
8062

81-
#ifdef TARGET
82-
// expected-warning@+2 {{modifier 'strict' is currently not supported on a GPU for the 'num_threads' clause; modifier ignored}}
83-
#endif
8463
#pragma omp parallel num_threads(strict: 1024) severity(fatal)
8564
{
8665
this->a = 2.5;

0 commit comments

Comments
 (0)