summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/atomic_init.c
blob: 243eb602cb199ac9c7c2d88ab13f96d2e3fa3e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s

// Check that no atomic operations are used in any initialisation of _Atomic
// types.  

_Atomic(int) i = 42;

void foo()
{
  _Atomic(int) j = 12; // CHECK: store 
                       // CHECK-NOT: atomic
  __atomic_init(&j, 42); // CHECK: store 
                         // CHECK-NOT: atomic
}
OpenPOWER on IntegriCloud