1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu %s -emit-llvm -o - | FileCheck %s
4 void CheckIntScalarTypes() {
5 // T will be substituted with 'int' and 'enum' types.
7 typedef T
__attribute__((mode(QI
))) T1
;
8 typedef T
__attribute__((mode(HI
))) T2
;
9 typedef T
__attribute__((mode(SI
))) T3
;
10 typedef T
__attribute__((mode(DI
))) T4
;
19 void CheckIntVectorTypes() {
20 // T will be substituted with 'int'.
22 typedef int __attribute__((mode(QI
))) __attribute__((vector_size(8))) VT_11
;
23 typedef T
__attribute__((mode(V8QI
))) VT_12
;
24 typedef int __attribute__((mode(SI
))) __attribute__((vector_size(16))) VT_21
;
25 typedef T
__attribute__((mode(V4SI
))) VT_22
;
26 typedef int __attribute__((mode(DI
))) __attribute__((vector_size(64))) VT_31
;
27 typedef T
__attribute__((mode(V8DI
))) VT_32
;
40 void CheckFloatVectorTypes() {
41 // T will be substituted with 'float'.
43 typedef float __attribute__((mode(SF
))) __attribute__((vector_size(128))) VT_41
;
44 typedef T
__attribute__((mode(V32SF
))) VT_42
;
45 typedef float __attribute__((mode(DF
))) __attribute__((vector_size(256))) VT_51
;
46 typedef T
__attribute__((mode(V32DF
))) VT_52
;
56 void CheckInstantiationWithModedType() {
60 typedef enum { A1
, B1
} EnumTy
;
61 typedef int __attribute__((mode(DI
))) Int64Ty1
;
62 typedef enum __attribute__((mode(DI
))) { A2
} Int64Ty2
;
63 typedef int __attribute__((mode(V8HI
))) IntVecTy1
;
67 // CHECK: define {{.*}} void @_Z19CheckIntScalarTypesIiEvv()
68 // CHECK: %{{.+}} = alloca i8
69 // CHECK: %{{.+}} = alloca i16
70 // CHECK: %{{.+}} = alloca i32
71 // CHECK: %{{.+}} = alloca i64
72 CheckIntScalarTypes
<int>();
74 // CHECK: define {{.*}} void @_Z19CheckIntScalarTypesI6EnumTyEvv()
75 // CHECK: %{{.+}} = alloca i8
76 // CHECK: %{{.+}} = alloca i16
77 // CHECK: %{{.+}} = alloca i32
78 // CHECK: %{{.+}} = alloca i64
79 CheckIntScalarTypes
<EnumTy
>();
81 // CHECK: define {{.*}} void @_Z19CheckIntVectorTypesIiEvv()
82 // CHECK: %{{.+}} = alloca <8 x i8>
83 // CHECK: %{{.+}} = alloca <8 x i8>
84 // CHECK: %{{.+}} = alloca <4 x i32>
85 // CHECK: %{{.+}} = alloca <4 x i32>
86 // CHECK: %{{.+}} = alloca <8 x i64>
87 // CHECK: %{{.+}} = alloca <8 x i64>
88 CheckIntVectorTypes
<int>();
90 // CHECK: define {{.*}} void @_Z21CheckFloatVectorTypesIfEvv()
91 // CHECK: %{{.+}} = alloca <32 x float>
92 // CHECK: %{{.+}} = alloca <32 x float>
93 // CHECK: %{{.+}} = alloca <32 x double>
94 // CHECK: %{{.+}} = alloca <32 x double>
95 CheckFloatVectorTypes
<float>();
97 // CHECK: define {{.*}} void @_Z31CheckInstantiationWithModedTypeIlEvv()
98 // CHECK: [[X1:%.+]] = alloca i64
99 CheckInstantiationWithModedType
<Int64Ty1
>();
101 // CHECK: define {{.*}} void @_Z31CheckInstantiationWithModedTypeI8Int64Ty2Evv()
102 // CHECK: [[X1]] = alloca i64
103 CheckInstantiationWithModedType
<Int64Ty2
>();
105 // CHECK: define {{.*}} void @_Z31CheckInstantiationWithModedTypeIDv8_sEvv()
106 // CHECK: [[X1]] = alloca <8 x i16>
107 CheckInstantiationWithModedType
<IntVecTy1
>();