blob: e9fdc9de3d23ce384da10e01a5e561948d7157db [file] [log] [blame]
Douglas Gregorbbcb7ea2011-09-09 16:51:10 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3// PR8345
4template<typename T> T f(T* value) {
5 return __sync_add_and_fetch(value, 1);
6}
7int g(long long* x) { return f(x); }
8int g(int* x) { return f(x); }
Douglas Gregor5b0c5192011-11-08 19:45:38 +00009
10namespace PR11320 {
11 template<typename T>
12 void g(unsigned *x) {
13 __sync_bool_compare_and_swap(x, 1, 4);
14 }
15 void h() { g<int>(0); }
16}