mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 19:47:05 +00:00

Summary: This attribute is mostly borrowed from OpenCL, but is useful in general for accessing the LLVM vector types. Previously the only way to use it was through typedefs. This patch changes that to allow use as a regular type attribute, similar to address spaces.
16 lines
708 B
C++
16 lines
708 B
C++
// RUN: %clang_cc1 %s -verify -ast-dump | FileCheck %s
|
|
|
|
// expected-no-diagnostics
|
|
|
|
// CHECK: ExtVectorType {{.*}} 'int __attribute__((ext_vector_type(4)))' 4
|
|
// CHECK-NEXT: BuiltinType {{.*}} 'int'
|
|
int x __attribute__((ext_vector_type(4)));
|
|
using ExtVecType = decltype(x);
|
|
|
|
// CHECK: FunctionDecl {{.*}} 'int () __attribute__((ext_vector_type(4)))'
|
|
int __attribute__((ext_vector_type(4))) foo() { return x; }
|
|
// CHECK: CompoundStmt
|
|
// CHECK-NEXT: ReturnStmt
|
|
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(4)))' <LValueToRValue>
|
|
// CHECK-NEXT: DeclRefExpr {{.*}} 'int __attribute__((ext_vector_type(4)))' lvalue Var {{.*}} 'x' 'int __attribute__((ext_vector_type(4)))'
|