Amara Emerson | 2440fb1 | 2013-09-16 18:07:35 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify "-triple" "thumbv7-apple-ios3.0.0" -target-feature +neon %s |
Fariborz Jahanian | 5da3c08 | 2011-04-14 20:33:36 +0000 | [diff] [blame] | 2 | // rdar://9208404 |
| 3 | |
| 4 | typedef int MP4Err; |
| 5 | typedef float Float32; |
| 6 | typedef float float32_t; |
| 7 | typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t; |
| 8 | typedef float vFloat __attribute__((__vector_size__(16))); |
| 9 | typedef vFloat VFLOAT; |
| 10 | typedef unsigned long UInt32; |
| 11 | |
| 12 | extern int bar (float32x4_t const *p); |
| 13 | |
| 14 | int foo (const Float32 *realBufPtr) { |
| 15 | float32x4_t const *vRealPtr = (VFLOAT *)&realBufPtr[0]; |
| 16 | return bar(vRealPtr); |
| 17 | } |
| 18 | |
| 19 | MP4Err autoCorrelation2nd_Neon(Float32 *alphar, Float32 *alphai, |
| 20 | const Float32 *realBufPtr, |
| 21 | const Float32 *imagBufPtr, |
| 22 | const UInt32 len) |
| 23 | { |
| 24 | float32x4_t const *vRealPtr = (VFLOAT *)&realBufPtr[0]; |
| 25 | return 0; |
| 26 | } |
| 27 | |
Douglas Gregor | 592a423 | 2012-06-29 01:05:22 +0000 | [diff] [blame] | 28 | namespace rdar11688587 { |
| 29 | typedef float float32_t; |
| 30 | typedef __attribute__((neon_vector_type(4))) float32_t float32x4_t; |
| 31 | |
| 32 | template<int I> |
| 33 | float test() |
| 34 | { |
| 35 | extern float32x4_t vec; |
| 36 | return __extension__ ({ |
| 37 | float32x4_t __a = (vec); |
| 38 | (float32_t)__builtin_neon_vgetq_lane_f32(__a, I); // expected-error{{argument should be a value from 0 to 3}} |
| 39 | }); |
| 40 | } |
| 41 | |
| 42 | template float test<1>(); |
| 43 | template float test<4>(); // expected-note{{in instantiation of function template specialization 'rdar11688587::test<4>' requested here}} |
| 44 | } |