Avoid -latomic for amdgcn offloading
authorRichard Biener <rguenther@suse.de>
Wed, 21 Apr 2021 12:54:05 +0000 (14:54 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 22 Apr 2021 06:29:11 +0000 (08:29 +0200)
libatomic isn't built for amdgcn but reduction-16.c adds it
via -foffload=-latomic when offloading for nvptx is enabled.
The following avoids linker errors when offloading to amdgcn is enabled
as well.

2021-04-21  Richard Biener  <rguenther@suse.de>

libgomp/
* testsuite/libgomp.c-c++-common/reduction-16.c: Use -latomic
only on nvptx-none.

libgomp/testsuite/libgomp.c-c++-common/reduction-16.c

index e60fe36..0eea73b 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-additional-options "-foffload=-latomic" { target offload_target_nvptx } } */
+/* { dg-additional-options "-foffload=nvptx-none=-latomic" { target offload_target_nvptx } } */
 
 #include <stdlib.h>