Skip to content

Commit 335f08c

Browse files
committed
fixed_extern
1 parent 1879ae1 commit 335f08c

6 files changed

+11
-51
lines changed

clang/test/OpenMP/target_update_strided_ptr_messages_from.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
22
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
33

4-
extern void *malloc(__SIZE_TYPE__);
5-
extern void free(void *);
6-
74
int main(int argc, char **argv) {
85
int len = 16;
9-
double *data = (double *)malloc(len * sizeof(double));
6+
double *data;
107

118
// Valid strided array sections with FROM
129
#pragma omp target update from(data[0:8:2]) // OK - even indices
@@ -39,6 +36,5 @@ int main(int argc, char **argv) {
3936
#pragma omp target update from(data[0:4:2:1]) // expected-error {{expected ']'}} expected-note {{to match this '['}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
4037
{}
4138

42-
free(data);
4339
return 0;
4440
}

clang/test/OpenMP/target_update_strided_ptr_messages_to.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
22
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
33

4-
extern void *malloc(__SIZE_TYPE__);
5-
extern void free(void *);
6-
74
int main(int argc, char **argv) {
85
int len = 16;
9-
double *data = (double *)malloc(len * sizeof(double));
6+
double *data;
107

118
// Valid strided array sections with TO
129
#pragma omp target update to(data[0:8:2]) // OK - even indices
@@ -39,6 +36,5 @@ int main(int argc, char **argv) {
3936
#pragma omp target update to(data[0:4:2:1]) // expected-error {{expected ']'}} expected-note {{to match this '['}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
4037
{}
4138

42-
free(data);
4339
return 0;
4440
}

clang/test/OpenMP/target_update_strided_ptr_multiple_messages_from.c

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
22
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
33

4-
extern void *malloc(__SIZE_TYPE__);
5-
extern void free(void *);
6-
7-
double *data;
8-
double *data1;
9-
double *data2;
10-
114
int main(int argc, char **argv) {
125
int len = 12;
13-
14-
// Allocate memory for explicit pointers
15-
data = (double *)malloc(len * sizeof(double));
16-
data1 = (double *)malloc(len * sizeof(double));
17-
data2 = (double *)malloc(len * sizeof(double));
6+
double *data;
7+
double *data1;
8+
double *data2;
189

1910
// Valid multiple strided array sections
2011
#pragma omp target update from(data1[0:6:2], data2[0:4:3]) // OK - different strides
@@ -56,9 +47,6 @@ int main(int argc, char **argv) {
5647
#pragma omp target update from(data1[0:4:2:3], data2[0:3:2]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
5748

5849
#pragma omp target update from(data[0:4:2], data1[0:3:2:1], data2[0:2:3]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
59-
60-
free(data);
61-
free(data1);
62-
free(data2);
50+
6351
return 0;
6452
}

clang/test/OpenMP/target_update_strided_ptr_multiple_messages_to.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
22
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
33

4-
extern void *malloc(__SIZE_TYPE__);
5-
extern void free(void *);
6-
7-
double *data;
8-
double *data1;
9-
double *data2;
10-
114
int main(int argc, char **argv) {
125
int len = 12;
13-
14-
// Allocate memory for explicit pointers
15-
data = (double *)malloc(len * sizeof(double));
16-
data1 = (double *)malloc(len * sizeof(double));
17-
data2 = (double *)malloc(len * sizeof(double));
6+
double *data;
7+
double *data1;
8+
double *data2;
189

1910
// Valid multiple strided array sections
2011
#pragma omp target update to(data1[0:6:2], data2[0:4:3]) // OK - different strides
@@ -57,8 +48,5 @@ int main(int argc, char **argv) {
5748

5849
#pragma omp target update to(data[0:4:2], data1[0:3:2:1], data2[0:2:3]) // expected-error {{expected ']'}} expected-note {{to match this '['}}
5950

60-
free(data);
61-
free(data1);
62-
free(data2);
6351
return 0;
6452
}

clang/test/OpenMP/target_update_strided_ptr_partial_messages_from.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
22
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
33

4-
extern void *malloc(__SIZE_TYPE__);
5-
extern void free(void *);
6-
74
int main(int argc, char **argv) {
85
int len = 11;
9-
double *data = (double *)malloc(len * sizeof(double));
6+
double *data;
107

118
// Valid partial strided sections with FROM
129
#pragma omp target update from(data[0:2:3]) // OK - partial coverage
@@ -36,6 +33,5 @@ int main(int argc, char **argv) {
3633
// Compile-time invalid strides
3734
#pragma omp target update from(data[1:2:-3]) // expected-error {{section stride is evaluated to a non-positive value -3}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
3835

39-
free(data);
4036
return 0;
4137
}

clang/test/OpenMP/target_update_strided_ptr_partial_messages_to.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
// RUN: %clang_cc1 -verify -fopenmp -ferror-limit 100 %s -Wuninitialized
22
// RUN: %clang_cc1 -verify -fopenmp-simd -ferror-limit 100 %s -Wuninitialized
33

4-
extern void *malloc(__SIZE_TYPE__);
5-
extern void free(void *);
6-
74
int main(int argc, char **argv) {
85
int len = 11;
9-
double *data = (double *)malloc(len * sizeof(double));
6+
double *data;
107

118
// Valid partial strided sections with TO
129
#pragma omp target update to(data[0:2:3]) // OK - partial coverage
@@ -35,6 +32,5 @@ int main(int argc, char **argv) {
3532
// Compile-time invalid strides
3633
#pragma omp target update to(data[1:2:-3]) // expected-error {{section stride is evaluated to a non-positive value -3}} expected-error {{expected at least one 'to' clause or 'from' clause specified to '#pragma omp target update'}}
3734

38-
free(data);
3935
return 0;
4036
}

0 commit comments

Comments
 (0)