diff mbox

[ptx] More test tweaks

Message ID ea5b06ca-8f0a-dca4-b4c4-77cbec41d760@acm.org
State New
Headers show

Commit Message

Nathan Sidwell May 17, 2016, 9:31 p.m. UTC
This adjusts a few more tests:
* I'd missed the optimization glob on a ptx skip-if, so it wasn't being skipped.
* An asm test relied on the register allocator being run to assign an input to 
the same register  as an output.
* An atomic test operated on automatic storage, which doesn't work on ptx -- 
atomic operations are only valid for global or shared memory.  Allocating it to 
static storage allows it to pass.
* PTX doesn't stick to the IEEE rules for one or more of denorms, zero or nan 
signedness.

nathan
diff mbox

Patch

2016-05-17  Nathan Sidwell  <nathan@acm.org>

	* gcc.c-torture/execute/20030222-1.c: Skip on ptx.
	* gcc.dg/pr68671.c: Fix ptx xfail-if.
	* gcc.dg/torture/pr54261-1.c: Allocate atomic var statically.
	* gcc.dg/torture/type-generic-1.c: Enable UNSAFE for ptx.

Index: gcc.c-torture/execute/20030222-1.c
===================================================================
--- gcc.c-torture/execute/20030222-1.c	(revision 236317)
+++ gcc.c-torture/execute/20030222-1.c	(working copy)
@@ -4,6 +4,7 @@ 
    actually truncated to int, in case a single register is wide enough
    for a long long.  */
 /* { dg-skip-if "asm would require extra shift-left-4-byte" { spu-*-* } "*" "" } */
+/* { dg-skip-if "asm requires register allocation" { nvptx-*-* } "*" "" } */
 #include <limits.h>
 
 void
Index: gcc.dg/pr68671.c
===================================================================
--- gcc.dg/pr68671.c	(revision 236317)
+++ gcc.dg/pr68671.c	(working copy)
@@ -1,7 +1,7 @@ 
 /* PR tree-optimization/68671 */
 /* { dg-do run } */
 /* { dg-options " -O2 -fno-tree-dce" } */
-/* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "" } { "" } } */
+/* { dg-xfail-if "ptxas crashes" { nvptx-*-* } { "*" } { "" } } */
 
 volatile int a = -1;
 volatile int b;
Index: gcc.dg/torture/pr54261-1.c
===================================================================
--- gcc.dg/torture/pr54261-1.c	(revision 236317)
+++ gcc.dg/torture/pr54261-1.c	(working copy)
@@ -32,7 +32,10 @@  void g (int *at, int val)
 
 int main(void)
 {
-  int x = 41;
+  /* On PTX it is not valid to perform atomic operations on auto
+     variables, which end up in .local.  Making this static places it
+     in .global.  */
+  static int x = 41;
   int a = 1;
   g (&x, a);
 
Index: gcc.dg/torture/type-generic-1.c
===================================================================
--- gcc.dg/torture/type-generic-1.c	(revision 236317)
+++ gcc.dg/torture/type-generic-1.c	(working copy)
@@ -3,7 +3,7 @@ 
 
 /* { dg-do run } */
 /* { dg-skip-if "No Inf/NaN support" { spu-*-* } } */
-/* { dg-options "-DUNSAFE" { target tic6x*-*-* visium-*-* } } */
+/* { dg-options "-DUNSAFE" { target tic6x*-*-* visium-*-* nvptx-*-* } } */
 /* { dg-add-options ieee } */
 
 #include "../tg-tests.h"