blob: c2b0acdab3cbdd4c9a29f519960f5fdf76594fb1 [file] [log] [blame]
Eric Christopher3883e662011-07-26 22:17:02 +00001// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2// XFAIL: sparc
3// rdar://7536390
4
Eli Friedmanc83b9752011-09-07 01:41:24 +00005typedef unsigned __INT32_TYPE__ uint32_t;
6
7unsigned t(uint32_t *ptr, uint32_t val) {
Eric Christopher3883e662011-07-26 22:17:02 +00008 // CHECK: @t
Eli Friedmanc83b9752011-09-07 01:41:24 +00009 // CHECK: atomicrmw xchg i32* {{.*}} seq_cst
Eric Christopher3883e662011-07-26 22:17:02 +000010 return __sync_lock_test_and_set(ptr, val);
11}