Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/ext/atomic-3.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/71675 - __atomic_compare_exchange_n returns wrong type for typed enum // { dg-do compile { target c++11 } } template <class T> void sink (T); bool sink (bool); template <class T> bool test () { enum class E: T { }; static E e; return sink (__atomic_compare_exchange_n (&e, &e, e, false, 0, 0)); } void tests () { // __atomic_compare_exchange_n would fail to return bool when // its arguments were one of the three character types. test<char>(); test<signed char>(); test<unsigned char>(); test<short>(); test<unsigned short>(); test<int>(); test<unsigned int>(); test<long>(); test<unsigned long>(); test<long long>(); test<unsigned long long>(); }