gcc/testsuite
Restore detection of unsupported TLS.
Revert this patch:
2007-02-10 Richard Henderson <rth@redhat.com>
* lib/target-supports.exp (check_effective_target_tls): Redefine
to mean non-emulated tls.
* gcc.dg/tls/alias-1.c: Remove tls requirement.
* gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
And then:
* lib/target-supports.exp (check_effective_target_tls): Use
stronger test for compiler support for TLS.
(check_effective_target_tls_native): New, to test for non-emulated
TLS support.
* g++.dg/gomp/clause-3.C: Use dg-require-effective-target tls_native
instead of dg-require-effective-target tls.
* g++.dg/gomp/copyin-1.C: Likewise.
* g++.dg/gomp/sharing-1.C: Likewise.
* g++.dg/gomp/tls-1.C: Likewise.
* g++.dg/gomp/tls-2.C: Likewise.
* g++.dg/gomp/tls-3.C: Likewise.
* g++.dg/tls/diag-1.C: Likewise.
* g++.dg/tls/diag-2.C: Likewise.
* g++.dg/tls/diag-3.C: Likewise.
* g++.dg/tls/diag-4.C: Likewise.
* g++.dg/tls/diag-5.C: Likewise.
* g++.dg/tls/init-1.C: Likewise.
* g++.dg/tls/init-2.C: Likewise.
* g++.dg/tls/trivial.C: Likewise.
* gcc.dg/gomp/appendix-a/a.22.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.22.2.c: Likewise.
* gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.32.1.c: Likewise.
* gcc.dg/gomp/appendix-a/a.33.1.c: Likewise.
* gcc.dg/gomp/clause-1.c: Likewise.
* gcc.dg/gomp/copyin-1.c: Likewise.
* gcc.dg/gomp/sharing-1.c: Likewise.
* gcc.dg/gomp/tls-1.c: Likewise.
* gcc.dg/gomp/tls-2.c: Likewise.
* gcc.dg/tls/alpha-1.c: Likewise.
* gcc.dg/tls/opt-1.c: Likewise.
* gcc.dg/tls/opt-13.c: Likewise.
* gcc.dg/tls/opt-14.c: Likewise.
* gcc.dg/tls/opt-2.c: Likewise.
* gcc.dg/tls/opt-3.c: Likewise.
* gcc.dg/tls/opt-4.c: Likewise.
* gcc.dg/tls/opt-7.c: Likewise.
* gcc.dg/tls/section-1.c: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.4.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.5.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.22.6.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.32.1.f90: Likewise.
* gfortran.dg/gomp/appendix-a/a.33.1.f90: Likewise.
* gfortran.dg/gomp/crayptr2.f90: Likewise.
* gfortran.dg/gomp/fixed-1.f: Likewise.
* gfortran.dg/gomp/free-1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate1.f90: Likewise.
* gfortran.dg/gomp/omp_threadprivate2.f90: Likewise.
* gfortran.dg/gomp/reduction1.f90: Likewise.
* gfortran.dg/gomp/sharing-1.f90: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128595
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-09-18 Sandra Loosemore <sandra@codesourcery.com>
+
+ Restore detection of unsupported TLS.
+
+ Revert this patch:
+ 2007-02-10 Richard Henderson <rth@redhat.com>
+
+ * lib/target-supports.exp (check_effective_target_tls): Redefine
+ to mean non-emulated tls.
+ * gcc.dg/tls/alias-1.c: Remove tls requirement.
+ * gcc.dg/tls/asm-1.c, gcc.dg/tls/debug-1.c, gcc.dg/tls/diag-1.c,
+ gcc.dg/tls/diag-2.c, gcc.dg/tls/diag-3.c, gcc.dg/tls/diag-4.c,
+ gcc.dg/tls/diag-5.c, gcc.dg/tls/init-1.c, gcc.dg/tls/nonpic-1.c,
+ gcc.dg/tls/opt-10.c, gcc.dg/tls/opt-5.c, gcc.dg/tls/opt-6.c,
+ gcc.dg/tls/opt-8.c, gcc.dg/tls/opt-9.c, gcc.dg/tls/pic-1.c,
+ gcc.dg/tls/struct-1.c, gcc.dg/tls/trivial.c: Likewise.
+
+ And then:
+ * lib/target-supports.exp (check_effective_target_tls): Use
+ stronger test for compiler support for TLS.
+ (check_effective_target_tls_native): New, to test for non-emulated
+ TLS support.
+ * g++.dg/gomp/clause-3.C: Use dg-require-effective-target tls_native
+ instead of dg-require-effective-target tls.
+ * g++.dg/gomp/copyin-1.C: Likewise.
+ * g++.dg/gomp/sharing-1.C: Likewise.
+ * g++.dg/gomp/tls-1.C: Likewise.
+ * g++.dg/gomp/tls-2.C: Likewise.
+ * g++.dg/gomp/tls-3.C: Likewise.
+ * g++.dg/tls/diag-1.C: Likewise.
+ * g++.dg/tls/diag-2.C: Likewise.
+ * g++.dg/tls/diag-3.C: Likewise.
+ * g++.dg/tls/diag-4.C: Likewise.
+ * g++.dg/tls/diag-5.C: Likewise.
+ * g++.dg/tls/init-1.C: Likewise.
+ * g++.dg/tls/init-2.C: Likewise.
+ * g++.dg/tls/trivial.C: Likewise.
+ * gcc.dg/gomp/appendix-a/a.22.1.c: Likewise.
+ * gcc.dg/gomp/appendix-a/a.22.2.c: Likewise.
+ * gcc.dg/gomp/appendix-a/a.24.1.c: Likewise.
+ * gcc.dg/gomp/appendix-a/a.32.1.c: Likewise.
+ * gcc.dg/gomp/appendix-a/a.33.1.c: Likewise.
+ * gcc.dg/gomp/clause-1.c: Likewise.
+ * gcc.dg/gomp/copyin-1.c: Likewise.
+ * gcc.dg/gomp/sharing-1.c: Likewise.
+ * gcc.dg/gomp/tls-1.c: Likewise.
+ * gcc.dg/gomp/tls-2.c: Likewise.
+ * gcc.dg/tls/alpha-1.c: Likewise.
+ * gcc.dg/tls/opt-1.c: Likewise.
+ * gcc.dg/tls/opt-13.c: Likewise.
+ * gcc.dg/tls/opt-14.c: Likewise.
+ * gcc.dg/tls/opt-2.c: Likewise.
+ * gcc.dg/tls/opt-3.c: Likewise.
+ * gcc.dg/tls/opt-4.c: Likewise.
+ * gcc.dg/tls/opt-7.c: Likewise.
+ * gcc.dg/tls/section-1.c: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.22.1.f90: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.22.4.f90: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.22.5.f90: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.22.6.f90: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.24.1.f90: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.32.1.f90: Likewise.
+ * gfortran.dg/gomp/appendix-a/a.33.1.f90: Likewise.
+ * gfortran.dg/gomp/crayptr2.f90: Likewise.
+ * gfortran.dg/gomp/fixed-1.f: Likewise.
+ * gfortran.dg/gomp/free-1.f90: Likewise.
+ * gfortran.dg/gomp/omp_threadprivate1.f90: Likewise.
+ * gfortran.dg/gomp/omp_threadprivate2.f90: Likewise.
+ * gfortran.dg/gomp/reduction1.f90: Likewise.
+ * gfortran.dg/gomp/sharing-1.f90: Likewise.
+
2007-09-18 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/31119
// { dg-do compile }
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
#define p parallel
// { dg-do compile }
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
int i, j;
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
int thrglobalvar;
#pragma omp threadprivate (thrglobalvar)
// { dg-do compile }
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
int tp1;
static int tp2;
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
extern char buf[];
#pragma omp threadprivate (buf) /* { dg-error "has incomplete type" } */
// { dg-do compile }
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
#define thr threadprivate
// Valid __thread specifiers.
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
__thread int g1;
extern __thread int g2;
/* Invalid __thread specifiers. */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
__thread extern int g1; /* { dg-error "'__thread' before 'extern'" } */
__thread static int g2; /* { dg-error "'__thread' before 'static'" } */
// Report invalid extern and __thread combinations.
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
extern int j; // { dg-error "previously declared here" }
__thread int j; // { dg-error "follows non-thread-local" }
/* Invalid __thread specifiers. */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
__thread typedef int g4; /* { dg-error "multiple storage classes" } */
// PR c++/30536
// Invalid __thread specifiers.
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
struct A { __thread register int i; }; // { dg-error "multiple storage classes|storage class specified" }
/* Valid initializations. */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
__thread int i = 42;
/* Invalid initializations. */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
extern __thread int i;
__thread int *p = &i; /* { dg-error "dynamically initialized" } */
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
__thread int i;
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
int counter = 0;
#pragma omp threadprivate(counter)
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
int
increment_counter_2 ()
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
extern int omp_get_num_threads (void);
int x, y, t, z[1000];
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
#include <stdlib.h>
float *work;
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
#include <stdio.h>
float x, y;
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
#define p parallel
// { dg-do compile }
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
int i, j;
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
#include <stdlib.h>
// { dg-do compile }
-// { dg-require-effective-target tls }
+// { dg-require-effective-target tls_native }
int tp1;
static int tp2;
/* { dg-do compile } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
extern char buf[];
#pragma omp threadprivate (buf) /* { dg-error "has incomplete type" } */
/* { dg-do link } */
/* { dg-require-alias "" } */
/* { dg-require-visibility "" } */
+/* { dg-require-effective-target tls } */
/* Test that encode_section_info handles the change from externally
defined to locally defined (via hidden). Extracted from glibc. */
/* Make sure that we honor initial-exec. */
/* { dg-do compile { target alpha*-*-* } } */
/* { dg-options "" } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
static __thread int xyzzy __attribute__ ((tls_model ("initial-exec")));
int foo(void) { return xyzzy; }
/* { dg-options "-Werror" } */
+/* { dg-require-effective-target tls } */
__thread int i;
int foo ()
/* { dg-do assemble } */
/* { dg-options "-g" } */
+/* { dg-require-effective-target tls } */
__thread int i;
/* Valid __thread specifiers. */
+/* { dg-require-effective-target tls } */
__thread int g1;
extern __thread int g2;
/* Invalid __thread specifiers. */
+/* { dg-require-effective-target tls } */
__thread extern int g1; /* { dg-error "'__thread' before 'extern'" } */
__thread static int g2; /* { dg-error "'__thread' before 'static'" } */
/* Report invalid extern and __thread combinations. */
+/* { dg-require-effective-target tls } */
extern int j; /* { dg-error "previous declaration" } */
__thread int j; /* { dg-error "follows non-thread-local" } */
/* Invalid __thread specifiers. As diag-4.c but some cases in
different orders. */
+/* { dg-require-effective-target tls } */
__thread typedef int g4; /* { dg-error "'__thread' used with 'typedef'" } */
/* __thread specifiers on empty declarations. */
+/* { dg-require-effective-target tls } */
__thread struct foo; /* { dg-warning "useless '__thread' in empty declaration" } */
/* Invalid initializations. */
+/* { dg-require-effective-target tls } */
extern __thread int i;
int *p = &i; /* { dg-error "initializer element is not constant" } */
/* { dg-do compile } */
/* { dg-options "-O2 -ftls-model=initial-exec" } */
+/* { dg-require-effective-target tls } */
extern __thread long e1;
extern __thread int e2;
/* { dg-do compile } */
/* { dg-options "-O2 -fPIC" } */
/* { dg-options "-O2 -fPIC -mtune=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
/* { dg-require-effective-target fpic } */
extern __thread int thr;
/* { dg-do compile } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O3 -fpic" } */
+/* { dg-require-effective-target tls } */
/* The web pass was creating unrecognisable pic_load_dot_plus_four insns
on ARM. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
__thread struct
{
used. */
/* { dg-do assemble } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
struct __res_state
{
/* { dg-do link } */
/* { dg-options "-O2 -ftls-model=initial-exec" } */
/* { dg-options "-O2 -ftls-model=initial-exec -march=i686" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
__thread int thr;
/* { dg-do compile } */
/* { dg-options "-O2 -fpic" } */
/* { dg-options "-O2 -fpic -mregparm=3" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
/* { dg-require-effective-target fpic } */
extern __thread int i, j, k;
/* { dg-do compile } */
/* { dg-options "-O2" } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
struct A
{
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
/* Sched1 moved {load_tp} pattern between strlen call and the copy
of the hard return value to its pseudo. This resulted in a
reload abort, since the hard register was not spillable. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
extern void abort (void);
extern void exit (int);
/* { dg-do compile } */
/* { dg-options "-O2 -fPIC" } */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
/* { dg-require-effective-target fpic } */
static __thread void *baz [4] __attribute__((tls_model ("initial-exec")));
/* PR 18910 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
+/* { dg-require-effective-target tls } */
static __thread void *foo [2];
void
/* { dg-do compile */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -fPIC" } */
+/* { dg-require-effective-target tls } */
struct S { int x[10]; };
extern __thread struct S s;
/* { dg-do compile } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -fpic -ftls-model=global-dynamic" } */
+/* { dg-require-effective-target tls } */
extern __thread long e1;
extern __thread int e2;
/* Verify that we get errors for trying to put TLS data in
sections which can't work. */
-/* { dg-require-effective-target tls } */
+/* { dg-require-effective-target tls_native } */
#define A(X) __attribute__((section(X)))
/* { dg-do compile } */
/* { dg-require-effective-target fpic } */
/* { dg-options "-O2 -fpic" } */
+/* { dg-require-effective-target tls } */
struct S {
int s0, s1, s2, s3;
+/* { dg-require-effective-target tls } */
+
__thread int i;
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
INTEGER FUNCTION INCREMENT_COUNTER()
COMMON/A22_COMMON/COUNTER
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
MODULE A22_MODULE
COMMON /T/ A
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
SUBROUTINE A22_5_WRONG()
COMMON /T/ A
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
SUBROUTINE A22_6_GOOD()
COMMON /T/ A
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
SUBROUTINE A24(A)
INTEGER A
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
MODULE M
REAL, POINTER, SAVE :: WORK(:)
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
SUBROUTINE INIT(A,B)
REAL A, B
! { dg-do compile }
! { dg-options "-fopenmp -fcray-pointer" }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
module crayptr2
integer :: e ! { dg-error "CRAY POINTEE attribute conflicts with THREADPRIVATE" }
C PR fortran/24493
C { dg-do compile }
-C { dg-require-effective-target tls }
+C { dg-require-effective-target tls_native }
INTEGER I, J, K, L, M
C$OMP THREADPRIVATE(I)
C SOME COMMENT
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
subroutine foo
integer, save :: i ! Some comment
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
module omp_threadprivate1
common /T/ a
end module omp_threadprivate1
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
subroutine bad1
double precision :: d ! { dg-error "isn't SAVEd" }
!$omp threadprivate (d)
! { dg-do compile }
! { dg-options "-fopenmp -fmax-errors=100" }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
subroutine foo (ia1)
integer :: i1, i2, i3
! { dg-do compile }
-! { dg-require-effective-target tls }
+! { dg-require-effective-target tls_native }
integer :: thrpriv, thr, i, j, s, g1, g2, m
integer, dimension (6) :: p
}]
}
-# Return 1 if *native* thread local storage (TLS) is supported, 0 otherwise.
+# Return 1 if thread local storage (TLS) is supported, 0 otherwise.
#
# This won't change for different subtargets so cache the result.
if [info exists et_tls_saved] {
verbose "check_effective_target_tls: using cached result" 2
} else {
- set et_tls_saved 1
+ set et_tls_saved 0
set src tls[pid].c
set asm tls[pid].S
verbose "check_effective_target_tls: compiling testfile $src" 2
set f [open $src "w"]
- # Compile a small test program.
+ # Compile a small test program. Make sure that we test accesses
+ # as well as declarations.
+ puts $f "__thread int i;\n"
+ puts $f "int f (void) { return i; }\n"
+ puts $f "void g (int j) { i = j; }\n"
+ close $f
+
+ # Test for thread-local data supported by the platform.
+ set comp_output \
+ [${tool}_target_compile $src $asm assembly ""]
+ file delete $src
+ if { [string match "" $comp_output] } {
+ # No error messages, everything is OK.
+ set et_tls_saved 1
+ }
+ remove-build-file $asm
+ }
+ verbose "check_effective_target_tls: returning $et_tls_saved" 2
+ return $et_tls_saved
+}
+
+# Return 1 if *native* thread local storage (TLS) is supported, 0 otherwise.
+#
+# This won't change for different subtargets so cache the result.
+
+proc check_effective_target_tls_native {} {
+ global et_tls_native_saved
+ global tool
+
+ if [info exists et_tls_saved] {
+ verbose "check_effective_target_tls_native: using cached result" 2
+ } else {
+ set et_tls_native_saved 0
+
+ set src tls[pid].c
+ set asm tls[pid].S
+ verbose "check_effective_target_tls_native: compiling testfile $src" 2
+ set f [open $src "w"]
+ # Compile a small test program. Make sure that we test accesses
+ # as well as declarations.
puts $f "__thread int i;\n"
+ puts $f "int f (void) { return i; }\n"
+ puts $f "void g (int j) { i = j; }\n"
close $f
# Test for thread-local data supported by the platform.
set comp_output [${tool}_target_compile $src $asm assembly ""]
file delete $src
- if { [string match "*not supported*" $comp_output] } {
- set et_tls_saved 0
- } else {
+ if { [string match "" $comp_output] } {
+ # No error messages, everything is OK.
set fd [open $asm r]
set text [read $fd]
close $fd
if { [string match "*emutls*" $text]} {
- set et_tls_saved 0
+ set et_tls_native_saved 0
} else {
- set et_tls_saved 1
+ set et_tls_native_saved 1
}
}
remove-build-file $asm
}
- verbose "check_effective_target_tls: returning $et_tls_saved" 2
- return $et_tls_saved
+ verbose "check_effective_target_tls_native: returning $et_tls_native_saved" 2
+ return $et_tls_native_saved
}
# Return 1 if TLS executables can run correctly, 0 otherwise.