aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CodeGen/2010-01-13-MemBarrier.c
blob: 1c60bb7056c42a664c700e7c8949618cdf1e2429 (plain)
1
2
3
4
5
6
7
8
9
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s

typedef unsigned __INT32_TYPE__ uint32_t;

unsigned t(uint32_t *ptr, uint32_t val) {
  // CHECK:      @t
  // CHECK: atomicrmw xchg ptr {{.*}} seq_cst, align 4
  return __sync_lock_test_and_set(ptr, val);
}