For nvptx, I see:
...
XPASS: c-c++-common/ident-0b.c -Wc++-compat scan-assembler-not GCC:
...
Fix this by requiring effective target ident_directive. Tested on nvptx.
gcc/testsuite/ChangeLog:
2020-10-15 Tom de Vries <tdevries@suse.de>
* c-c++-common/ident-0b.c: Require effective target ident_directive.
* Make sure scan-assembler-not turns off .ident unless -fident in testcase */
/* { dg-do compile } */
/* { dg-options "-fident" } */
+/* { dg-require-effective-target ident_directive }*/
/* { dg-skip-if "no assembler .ident support" { { hppa*-*-hpux* && { ! lp64 } } || powerpc*-*-darwin* } } */
int i;