1 // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
2 
3 void foo(int x)
4 {
5   _Atomic(int) i = 0;
6   _Atomic(short) j = 0;
7   // Check that multiply / divides on atomics produce a cmpxchg loop
8   i *= 2;
9   // CHECK: mul nsw i32
10   // CHECK: cmpxchg i32*
11   i /= 2;
12   // CHECK: sdiv i32
13   // CHECK: cmpxchg i32*
14   j /= x;
15   // CHECK: sdiv i32
16   // CHECK: cmpxchg i16*
17 
18 }
19