From 730f28b081bea4a749f9b82902446731ec8faa93 Mon Sep 17 00:00:00 2001
From: Thomas Schwinge <tschwinge@baylibre.com>
Date: Sat, 9 Nov 2024 13:37:53 +0100
Subject: [PATCH] Adjust 'libgomp.c/max_vf-*.c'
For configurations where both GCN and nvptx offloading are enabled, we get:
PASS: libgomp.c/max_vf-1.c (test for excess errors)
PASS: libgomp.c/max_vf-1.c scan-tree-dump-times ompexp "GOMP_MAX_VF" 2
PASS: libgomp.c/max_vf-1.c scan-tree-dump-times ompexp "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, D\\.[0-9]*, 0\\);" 1
PASS: libgomp.c/max_vf-1.c scan-amdgcn-amdhsa-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 64, 0\\);" 1
FAIL: libgomp.c/max_vf-1.c scan-nvptx-none-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 64, 0\\);" 1
FAIL: libgomp.c/max_vf-1.c scan-amdgcn-amdhsa-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 7, 0\\);" 1
PASS: libgomp.c/max_vf-1.c scan-nvptx-none-offload-tree-dump-times optimized "__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \\(.*, 7, 0\\);" 1
Avoid these FAILs via 'only_for_offload_target [...]'. Also, for consistency
with other libgomp test cases, use effective-target specifiers of the libgomp
test suite. Fix-up for recent commit d334f729e53867b838e867375b3f475ba793d96e
"openmp: Add testcases for omp_max_vf".
libgomp/
* testsuite/libgomp.c/max_vf-1.c: Adjust.
* testsuite/libgomp.c/max_vf-2.c: Likewise.
---
libgomp/testsuite/libgomp.c/max_vf-1.c | 6 +++---
libgomp/testsuite/libgomp.c/max_vf-2.c | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
@@ -1,7 +1,7 @@
/* Test that omp parallel simd schedule uses the correct max_vf for the
host system, when target directives are present. */
-/* { dg-require-effective-target offloading_enabled } */
+/* { dg-require-effective-target offload_target_any } */
/* { dg-do link } */
/* { dg-options "-fopenmp -O2 -fdump-tree-ompexp -foffload=-fdump-tree-optimized" } */
@@ -41,7 +41,7 @@ f3 (int *a, int *b, int *c)
{ dg-final { scan-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, D\.[0-9]*, 0\);} 1 "ompexp" { target { x86_64-*-* i?86-*-* } } } } */
/* Test SIMD offload devices
-{ dg-final { scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 64, 0\);} 1 "optimized" { target { offload_gcn } } } }
-{ dg-final { scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 7, 0\);} 1 "optimized" { target { offload_nvptx } } } } */
+{ dg-final { only_for_offload_target amdgcn-amdhsa scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 64, 0\);} 1 "optimized" { target offload_target_amdgcn } } }
+{ dg-final { only_for_offload_target nvptx-none scan-offload-tree-dump-times {__builtin_GOMP_parallel_loop_nonmonotonic_dynamic \(.*, 7, 0\);} 1 "optimized" { target offload_target_nvptx } } } */
int main() {}
@@ -1,7 +1,7 @@
/* Ensure that the default safelen is set correctly for the larger of the host
and offload device, to prevent defeating the vectorizer. */
-/* { dg-require-effective-target offloading_enabled } */
+/* { dg-require-effective-target offload_target_any } */
/* { dg-do link } */
/* { dg-options "-fopenmp -O2 -fdump-tree-omplower" } */
@@ -16,6 +16,6 @@ int f(float *a, float *b, int n)
}
/* Make sure that the max_vf used is suitable for the offload device.
-{ dg-final { scan-tree-dump-times {omp simd safelen\(64\)} 1 "omplower" { target { offload_gcn } } } } */
+{ dg-final { scan-tree-dump-times {omp simd safelen\(64\)} 1 "omplower" { target offload_target_amdgcn } } } */
int main() {}
--
2.34.1