xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2010-01-13-MemBarrier.c (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2*f4a2713aSLionel Sambuc // rdar://7536390
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc typedef unsigned __INT32_TYPE__ uint32_t;
5*f4a2713aSLionel Sambuc 
t(uint32_t * ptr,uint32_t val)6*f4a2713aSLionel Sambuc unsigned t(uint32_t *ptr, uint32_t val) {
7*f4a2713aSLionel Sambuc   // CHECK:      @t
8*f4a2713aSLionel Sambuc   // CHECK: atomicrmw xchg i32* {{.*}} seq_cst
9*f4a2713aSLionel Sambuc   return __sync_lock_test_and_set(ptr, val);
10*f4a2713aSLionel Sambuc }
11