Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -emit-llvm %s -o - |
Anders Carlsson | 79b67f3 | 2008-02-01 23:17:55 +0000 | [diff] [blame] | 2 | typedef short __v4hi __attribute__ ((__vector_size__ (8))); |
| 3 | |
| 4 | void f() |
| 5 | { |
| 6 | __v4hi A = (__v4hi)0LL; |
Anders Carlsson | 2cec15f | 2008-02-01 23:27:51 +0000 | [diff] [blame] | 7 | } |
Eli Friedman | cfb313b | 2008-05-30 12:02:14 +0000 | [diff] [blame] | 8 | |
| 9 | __v4hi x = {1,2,3}; |
| 10 | __v4hi y = {1,2,3,4}; |
Eli Friedman | daa24a2 | 2009-03-28 02:45:41 +0000 | [diff] [blame] | 11 | |
Eli Friedman | 3ded200 | 2009-03-28 03:14:28 +0000 | [diff] [blame] | 12 | typedef int vty __attribute((vector_size(16))); |
| 13 | int a() { vty b; return b[2LL]; } |
Eli Friedman | 61d004a | 2009-06-06 19:09:26 +0000 | [diff] [blame^] | 14 | |
| 15 | // PR4339 |
| 16 | typedef float vec4 __attribute__((vector_size(16))); |
| 17 | |
| 18 | void vac ( vec4* a, char b, float c ) |
| 19 | { |
| 20 | (*a)[b] = c; |
| 21 | } |