summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gomp/atomic-11.c
blob: 397972b3cf21d82cc4db8413f90aa08c37ebe667 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* PR middle-end/36877 */
/* { dg-do compile } */
/* { dg-options "-fopenmp" } */
/* { dg-options "-fopenmp -march=i386" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */

int i;
float f;

void foo (void)
{
#pragma omp atomic
  i++;
#pragma omp atomic
  f += 1.0;
}

/* { dg-final { scan-assembler-not "__sync_(fetch|add|bool|val)" { target i?86-*-* x86_64-*-* powerpc*-*-* ia64-*-* s390*-*-* sparc*-*-* } } } */