diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-28 03:31:48 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-28 03:31:48 +0000 |
commit | 9c129f818038e0269ba6b095722aa70176dc321d (patch) | |
tree | cc0c5803a179a1d8ccb3202bd6c6bd28a3a0ac13 /test/SemaCXX/vector.cpp | |
parent | ac51650d054c2eaada48d54dba52c08153d2daed (diff) |
Add (hopefully) the last missing lvalue-to-rvalue conversion. Add an assertion
to catch some future implicit lvalue-to-rvalue casts of inappropriate kinds.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/vector.cpp')
-rw-r--r-- | test/SemaCXX/vector.cpp | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/SemaCXX/vector.cpp b/test/SemaCXX/vector.cpp index 4d3d93974c..82245ac29b 100644 --- a/test/SemaCXX/vector.cpp +++ b/test/SemaCXX/vector.cpp @@ -218,3 +218,52 @@ void test(fltx2 fltx2_val, fltx4 fltx4_val, dblx2 dblx2_val, dblx4 dblx4_val) { // Scalar-to-vector conversions. accept_fltx2(1.0); // expected-error{{no matching function for call to 'accept_fltx2'}} } + +typedef int intx4 __attribute__((__vector_size__(16))); +typedef int inte4 __attribute__((__ext_vector_type__(4))); +typedef int flte4 __attribute__((__ext_vector_type__(4))); + +void test_mixed_vector_types(fltx4 f, intx4 n, flte4 g, flte4 m) { + (void)(f == g); + (void)(g != f); + (void)(f <= g); + (void)(g >= f); + (void)(f < g); + (void)(g > f); + + (void)(+g); + (void)(-g); + + (void)(f + g); + (void)(f - g); + (void)(f * g); + (void)(f / g); + (void)(f = g); + (void)(f += g); + (void)(f -= g); + (void)(f *= g); + (void)(f /= g); + + + (void)(n == m); + (void)(m != n); + (void)(n <= m); + (void)(m >= n); + (void)(n < m); + (void)(m > n); + + (void)(+m); + (void)(-m); + (void)(~m); + + (void)(n + m); + (void)(n - m); + (void)(n * m); + (void)(n / m); + (void)(n % m); + (void)(n = m); + (void)(n += m); + (void)(n -= m); + (void)(n *= m); + (void)(n /= m); +} |