diff --git a/openmp/runtime/test/affinity/format/api2.c b/openmp/runtime/test/affinity/format/api2.c --- a/openmp/runtime/test/affinity/format/api2.c +++ b/openmp/runtime/test/affinity/format/api2.c @@ -13,8 +13,8 @@ #define check(condition) \ if (!(condition)) { \ - fprintf(stderr, "error: %s: %d: " STR(condition) "\n", __FILE__, \ - __LINE__); \ + fprintf(stderr, "error: %s: %d: %s\n", __FILE__, __LINE__, \ + STR(condition)); \ exit(1); \ } diff --git a/openmp/runtime/test/api/omp_alloc_def_fb.c b/openmp/runtime/test/api/omp_alloc_def_fb.c --- a/openmp/runtime/test/api/omp_alloc_def_fb.c +++ b/openmp/runtime/test/api/omp_alloc_def_fb.c @@ -12,8 +12,8 @@ at[1].key = omp_atk_fallback; at[1].value = omp_atv_default_mem_fb; a = omp_init_allocator(omp_large_cap_mem_space, 2, at); - printf("allocator large created: %p\n", a); - #pragma omp parallel num_threads(2) + printf("allocator large created: %p\n", (void *)a); +#pragma omp parallel num_threads(2) { int i = omp_get_thread_num(); p[i] = omp_alloc(1024 * 1024, a); diff --git a/openmp/runtime/test/api/omp_alloc_hbw.c b/openmp/runtime/test/api/omp_alloc_hbw.c --- a/openmp/runtime/test/api/omp_alloc_hbw.c +++ b/openmp/runtime/test/api/omp_alloc_hbw.c @@ -12,8 +12,8 @@ at[1].key = omp_atk_fallback; at[1].value = omp_atv_null_fb; a = omp_init_allocator(omp_high_bw_mem_space, 2, at); - printf("allocator hbw created: %p\n", a); - #pragma omp parallel num_threads(2) + printf("allocator hbw created: %p\n", (void *)a); +#pragma omp parallel num_threads(2) { int i = omp_get_thread_num(); p[i] = omp_alloc(1024 * 1024, a); diff --git a/openmp/runtime/test/api/omp_alloc_null_fb.c b/openmp/runtime/test/api/omp_alloc_null_fb.c --- a/openmp/runtime/test/api/omp_alloc_null_fb.c +++ b/openmp/runtime/test/api/omp_alloc_null_fb.c @@ -12,8 +12,8 @@ at[1].key = omp_atk_fallback; at[1].value = omp_atv_null_fb; a = omp_init_allocator(omp_large_cap_mem_space, 2, at); - printf("allocator large created: %p\n", a); - #pragma omp parallel num_threads(2) + printf("allocator large created: %p\n", (void *)a); +#pragma omp parallel num_threads(2) { int i = omp_get_thread_num(); #pragma omp barrier diff --git a/openmp/runtime/test/api/omp_display_env0.c b/openmp/runtime/test/api/omp_display_env0.c --- a/openmp/runtime/test/api/omp_display_env0.c +++ b/openmp/runtime/test/api/omp_display_env0.c @@ -1,5 +1,5 @@ // RUN: %libomp-compile-and-run 2>&1 | FileCheck %s -// RUN: %libomp-cxx-compile-and-run 2>&1 | FileCheck %s +// RUN: %libomp-cxx-compile-c && %libomp-run 2>&1 | FileCheck %s #include #include int main() diff --git a/openmp/runtime/test/env/omp_target_offload.c b/openmp/runtime/test/env/omp_target_offload.c --- a/openmp/runtime/test/env/omp_target_offload.c +++ b/openmp/runtime/test/env/omp_target_offload.c @@ -9,6 +9,7 @@ }; extern int __kmpc_get_target_offload(); +extern void kmp_set_defaults(char const *str); const char *disabled_examples[] = { // Allowed inputs diff --git a/openmp/runtime/test/lit.cfg b/openmp/runtime/test/lit.cfg --- a/openmp/runtime/test/lit.cfg +++ b/openmp/runtime/test/lit.cfg @@ -116,6 +116,8 @@ "%libomp-compile && %libomp-run")) config.substitutions.append(("%libomp-cxx-compile-and-run", \ "%libomp-cxx-compile && %libomp-run")) +config.substitutions.append(("%libomp-cxx-compile-c", \ + "%clangXX %openmp_flags %flags -std=c++14 -x c++ %s -o %t" + libs)) config.substitutions.append(("%libomp-cxx-compile", \ "%clangXX %openmp_flags %flags -std=c++14 %s -o %t" + libs)) config.substitutions.append(("%libomp-compile", \ diff --git a/openmp/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c b/openmp/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c --- a/openmp/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c +++ b/openmp/runtime/test/misc_bugs/omp_foreign_thread_team_reuse.c @@ -37,6 +37,7 @@ a++; } } + return NULL; } int test_omp_team_reuse() diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c --- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c +++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c @@ -128,7 +128,7 @@ // Guided scheduling uses FP computations, so current chunk may // be a bit bigger (+1) than allowed maximum if (!(cur <= max + 1)) { - printf("Error with iter %d, %d\n", cur, max); + printf("Error with iter %llu, %llu\n", cur, max); err++; } // Update maximum for the next chunk @@ -280,7 +280,7 @@ // Guided scheduling uses FP computations, so current chunk may // be a bit bigger (+1) than allowed maximum if (!(cur <= max + 1)) { - printf("Error with iter %d, %d\n", cur, max); + printf("Error with iter %llu, %llu\n", cur, max); err++; } // Update maximum for the next chunk diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c --- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c +++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_api.c @@ -132,7 +132,7 @@ // Guided scheduling uses FP computations, so current chunk may // be a bit bigger (+1) than allowed maximum. if (!( cur <= max + 1)) - printf("Error with iter %d, %d, err %d\n", cur, max, ++err); + printf("Error with iter %llu, %llu, err %d\n", cur, max, ++err); // Update maximum for the next chunk. if (last) { if (!no_chunk && cur > ch && nthreads > 1) diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c --- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c +++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_guided.c @@ -140,7 +140,7 @@ // Guided scheduling uses FP computations, so current chunk may // be a bit bigger (+1) than allowed maximum. if (!( cur <= max + 1)) - printf("Error with iter %d, %d, err %d\n", cur, max, ++err); + printf("Error with iter %llu, %llu, err %d\n", cur, max, ++err); // Update maximum for the next chunk. if (!last && cur % ch) printf("Error with chunk %d, %d, ch %d, tid %d, err %d\n", diff --git a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c --- a/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c +++ b/openmp/runtime/test/worksharing/for/kmp_sch_simd_runtime_static.c @@ -5,6 +5,7 @@ // in combination with OMP_SCHEDULE=static[,chunk] #include #include +#include #include #if defined(WIN32) || defined(_WIN32) @@ -133,7 +134,7 @@ // Guided scheduling uses FP computations, so current chunk may // be a bit bigger (+1) than allowed maximum. if (!( cur <= max + 1)) - printf("Error with iter %d, %d, err %d\n", cur, max, ++err); + printf("Error with iter %llu, %llu, err %d\n", cur, max, ++err); // Update maximum for the next chunk. if (last) { if (!no_chunk && cur > ch && nthreads > 1)