Skip to content

Commit 74ee49f

Browse files
committed
more tests
1 parent 728e1bd commit 74ee49f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

clang/test/CodeGen/vector.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ void test1(void) {
88
__v4hi x = {1,2,3};
99
__v4hi y = {1,2,3,4};
1010

11+
12+
// CHECK: @z = local_unnamed_addr global <8 x float> zeroinitializer
13+
float z __attribute__((ext_vector_type(8)));
14+
1115
typedef int vty __attribute((vector_size(16)));
1216
int test2(void) { vty b; return b[2LL]; }
1317

@@ -18,9 +22,6 @@ void test3 ( vec4* a, char b, float c ) {
1822
(*a)[b] = c;
1923
}
2024

21-
22-
23-
2425
#include <mmintrin.h>
2526

2627
int test4(int argc, char *argv[]) {

clang/test/Sema/vector-ast.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %clang_cc1 %s -verify -ast-dump | FileCheck %s
2+
3+
// expected-no-diagnostics
4+
5+
// CHECK: VarDecl {{.*}} x 'int __attribute__((ext_vector_type(4)))'
6+
int x __attribute__((ext_vector_type(4)));
7+
8+
// CHECK: FunctionDecl {{.*}} 'int () __attribute__((ext_vector_type(4)))'
9+
int __attribute__((ext_vector_type(4))) foo() { return x; }
10+
// CHECK: CompoundStmt
11+
// CHECK-NEXT: ReturnStmt
12+
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int __attribute__((ext_vector_type(4)))' <LValueToRValue>
13+
// CHECK-NEXT: DeclRefExpr {{.*}} 'int __attribute__((ext_vector_type(4)))' lvalue Var {{.*}} 'x' 'int __attribute__((ext_vector_type(4)))'

0 commit comments

Comments
 (0)