]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/testsuite/18_support/bad_exception/23591_thread-1.c
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / testsuite / 18_support / bad_exception / 23591_thread-1.c
index 9e621c3f786094245e51c1c772a440415c62add7..47365d9b3a139f4634c9da0a64b3c460e4b77abe 100644 (file)
@@ -1,7 +1,8 @@
 // { dg-require-sharedlib "" }
-// { dg-options "-g -O2 -pthread -ldl -x c" { target *-*-linux* } }
+// { dg-skip-if "invalid options for C" { *-*-* } { "-std=c++??" "-std=gnu++??" } }
+// { dg-options "-g -O2 -pthread -ldl -x c -fvtable-verify=none -Wno-pedantic" { target *-*-linux* *-*-gnu* *-*-solaris2.1[2-9]* } }
 
-// Copyright (C) 2005, 2009 Free Software Foundation, Inc.
+// Copyright (C) 2005-2021 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
@@ -32,20 +33,20 @@ static void* run(void* arg)
   void (*cb)();
 
   lib = dlopen("./testsuite_shared.so", RTLD_NOW);
-  if (lib == NULL)
+  if (!lib)
     {
       printf("dlopen failed: %s\n", strerror(errno));
-      return NULL;
+      return 0;
     }
   cb = (function_type) dlsym(lib, "try_throw_exception");
-  if (cb == NULL)
+  if (!cb)
     {
       printf("dlsym failed: %s\n", strerror(errno));
-      return NULL;
+      return 0;
     }
   cb();
   dlclose(lib);
-  return NULL;
+  return 0;
 }
 
 // libstdc++/23591
@@ -53,9 +54,9 @@ int main(void)
 {
   pthread_t pt;
 
-  if (pthread_create(&pt, NULL, &run, NULL) != 0)
+  if (pthread_create(&pt, 0, &run, 0) != 0)
     return 1;
-  if (pthread_join(pt, NULL) != 0)
+  if (pthread_join(pt, 0) != 0)
     return 1;
 
   return 0;