(root)/
gcc-13.2.0/
libgomp/
testsuite/
libgomp.c-c++-common/
atomic-18.c
       1  /* PR c/64824 */
       2  /* { dg-do run } */
       3  
       4  void
       5  f1 (void)
       6  {
       7    short a;
       8    short b = 1;
       9    int c = 3;
      10  #pragma omp atomic capture
      11    a = b = c << b;
      12    if (b != 6 || a != 6)
      13      __builtin_abort ();
      14  }
      15  
      16  void
      17  f2 (void)
      18  {
      19    short a;
      20    short b = 1;
      21    int c = 3;
      22  #pragma omp atomic capture
      23    a = b = c + b;
      24    if (b != 4 || a != 4)
      25      __builtin_abort ();
      26  }
      27  
      28  void
      29  f3 (void)
      30  {
      31    short a;
      32    short b = 1;
      33    long long int c = 3;
      34  #pragma omp atomic capture
      35    a = b = c + b;
      36    if (b != 4 || a != 4)
      37      __builtin_abort ();
      38  }
      39  
      40  void
      41  f4 (void)
      42  {
      43    char a;
      44    char b = 1;
      45    long long int c = 3LL;
      46  #pragma omp atomic capture
      47    a = b = c << b;
      48    if (b != 6 || a != 6)
      49      __builtin_abort ();
      50  }
      51  
      52  int
      53  main ()
      54  {
      55    f1 ();
      56    f2 ();
      57    f3 ();
      58    f4 ();
      59    return 0;
      60  }