46 changes: 23 additions & 23 deletions clang/test/CodeGen/matrix-type-builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ typedef unsigned ux1x6_t __attribute__((matrix_type(1, 6)));
typedef unsigned ux6x1_t __attribute__((matrix_type(6, 1)));

void transpose_double_5x5(dx5x5_t *a) {
// CHECK-LABEL: define void @transpose_double_5x5(
// CHECK-LABEL: define{{.*}} void @transpose_double_5x5(
// CHECK: [[A:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[TRANS:%.*]] = call <25 x double> @llvm.matrix.transpose.v25f64(<25 x double> [[A]], i32 5, i32 5)
// CHECK-NEXT: [[AT_ADDR:%.*]] = bitcast [25 x double]* %a_t to <25 x double>*
Expand All @@ -24,7 +24,7 @@ void transpose_double_5x5(dx5x5_t *a) {
}

void transpose_float_3x2(fx3x2_t *a) {
// CHECK-LABEL: define void @transpose_float_3x2(
// CHECK-LABEL: define{{.*}} void @transpose_float_3x2(
// CHECK: [[A:%.*]] = load <6 x float>, <6 x float>* {{.*}}, align 4
// CHECK-NEXT: [[TRANS:%.*]] = call <6 x float> @llvm.matrix.transpose.v6f32(<6 x float> [[A]], i32 3, i32 2)
// CHECK-NEXT: [[AT_ADDR:%.*]] = bitcast [6 x float]* %a_t to <6 x float>*
Expand All @@ -34,7 +34,7 @@ void transpose_float_3x2(fx3x2_t *a) {
}

void transpose_int_20x4(ix20x4_t *a) {
// CHECK-LABEL: define void @transpose_int_20x4(
// CHECK-LABEL: define{{.*}} void @transpose_int_20x4(
// CHECK: [[A:%.*]] = load <80 x i32>, <80 x i32>* {{.*}}, align 4
// CHECK-NEXT: [[TRANS:%.*]] = call <80 x i32> @llvm.matrix.transpose.v80i32(<80 x i32> [[A]], i32 20, i32 4)
// CHECK-NEXT: [[AT_ADDR:%.*]] = bitcast [80 x i32]* %a_t to <80 x i32>*
Expand All @@ -49,7 +49,7 @@ struct Foo {
};

void transpose_struct_member(struct Foo *F) {
// CHECK-LABEL: define void @transpose_struct_member(
// CHECK-LABEL: define{{.*}} void @transpose_struct_member(
// CHECK: [[M:%.*]] = load <6 x i32>, <6 x i32>* {{.*}}, align 4
// CHECK-NEXT: [[M_T:%.*]] = call <6 x i32> @llvm.matrix.transpose.v6i32(<6 x i32> [[M]], i32 1, i32 6)
// CHECK-NEXT: [[F_ADDR:%.*]] = load %struct.Foo*, %struct.Foo** %F.addr, align 8
Expand All @@ -61,7 +61,7 @@ void transpose_struct_member(struct Foo *F) {
}

void transpose_transpose_struct_member(struct Foo *F) {
// CHECK-LABEL: define void @transpose_transpose_struct_member(
// CHECK-LABEL: define{{.*}} void @transpose_transpose_struct_member(
// CHECK: [[M:%.*]] = load <6 x i32>, <6 x i32>* {{.*}}, align 4
// CHECK-NEXT: [[M_T:%.*]] = call <6 x i32> @llvm.matrix.transpose.v6i32(<6 x i32> [[M]], i32 1, i32 6)
// CHECK-NEXT: [[M_T2:%.*]] = call <6 x i32> @llvm.matrix.transpose.v6i32(<6 x i32> [[M_T]], i32 6, i32 1)
Expand All @@ -76,7 +76,7 @@ void transpose_transpose_struct_member(struct Foo *F) {
dx5x5_t get_matrix();

void transpose_rvalue() {
// CHECK-LABEL: define void @transpose_rvalue()
// CHECK-LABEL: define{{.*}} void @transpose_rvalue()
// CHECK-NEXT: entry:
// CHECK-NEXT: [[M_T_ADDR:%.*]] = alloca [25 x double], align 8
// CHECK-NEXT: [[CALL:%.*]] = call <25 x double> (...) @get_matrix()
Expand All @@ -90,7 +90,7 @@ void transpose_rvalue() {
const dx5x5_t global_matrix;

void transpose_global() {
// CHECK-LABEL: define void @transpose_global()
// CHECK-LABEL: define{{.*}} void @transpose_global()
// CHECK-NEXT: entry:
// CHECK-NEXT: [[M_T_ADDR:%.*]] = alloca [25 x double], align 8
// CHECK-NEXT: [[GLOBAL_MATRIX:%.*]] = load <25 x double>, <25 x double>* bitcast ([25 x double]* @global_matrix to <25 x double>*), align 8
Expand All @@ -102,23 +102,23 @@ void transpose_global() {
}

void column_major_load_with_const_stride_double(double *Ptr) {
// CHECK-LABEL: define void @column_major_load_with_const_stride_double(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_load_with_const_stride_double(double* %Ptr)
// CHECK: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call <25 x double> @llvm.matrix.column.major.load.v25f64(double* align 8 [[PTR]], i64 5, i1 false, i32 5, i32 5)

dx5x5_t m_a1 = __builtin_matrix_column_major_load(Ptr, 5, 5, 5);
}

void column_major_load_with_const_stride2_double(double *Ptr) {
// CHECK-LABEL: define void @column_major_load_with_const_stride2_double(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_load_with_const_stride2_double(double* %Ptr)
// CHECK: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call <25 x double> @llvm.matrix.column.major.load.v25f64(double* align 8 [[PTR]], i64 15, i1 false, i32 5, i32 5)

dx5x5_t m_a2 = __builtin_matrix_column_major_load(Ptr, 5, 5, 2 * 3 + 9);
}

void column_major_load_with_variable_stride_ull_float(float *Ptr, unsigned long long S) {
// CHECK-LABEL: define void @column_major_load_with_variable_stride_ull_float(float* %Ptr, i64 %S)
// CHECK-LABEL: define{{.*}} void @column_major_load_with_variable_stride_ull_float(float* %Ptr, i64 %S)
// CHECK: [[S:%.*]] = load i64, i64* %S.addr, align 8
// CHECK-NEXT: [[PTR:%.*]] = load float*, float** %Ptr.addr, align 8
// CHECK-NEXT: call <6 x float> @llvm.matrix.column.major.load.v6f32(float* align 4 [[PTR]], i64 [[S]], i1 false, i32 2, i32 3)
Expand All @@ -127,7 +127,7 @@ void column_major_load_with_variable_stride_ull_float(float *Ptr, unsigned long
}

void column_major_load_with_stride_math_int(int *Ptr, int S) {
// CHECK-LABEL: define void @column_major_load_with_stride_math_int(i32* %Ptr, i32 %S)
// CHECK-LABEL: define{{.*}} void @column_major_load_with_stride_math_int(i32* %Ptr, i32 %S)
// CHECK: [[S:%.*]] = load i32, i32* %S.addr, align 4
// CHECK-NEXT: [[STRIDE:%.*]] = add nsw i32 [[S]], 32
// CHECK-NEXT: [[STRIDE_EXT:%.*]] = sext i32 [[STRIDE]] to i64
Expand All @@ -138,7 +138,7 @@ void column_major_load_with_stride_math_int(int *Ptr, int S) {
}

void column_major_load_with_stride_math_s_int(int *Ptr, short S) {
// CHECK-LABEL: define void @column_major_load_with_stride_math_s_int(i32* %Ptr, i16 signext %S)
// CHECK-LABEL: define{{.*}} void @column_major_load_with_stride_math_s_int(i32* %Ptr, i16 signext %S)
// CHECK: [[S:%.*]] = load i16, i16* %S.addr, align 2
// CHECK-NEXT: [[S_EXT:%.*]] = sext i16 [[S]] to i32
// CHECK-NEXT: [[STRIDE:%.*]] = add nsw i32 [[S_EXT]], 32
Expand All @@ -150,15 +150,15 @@ void column_major_load_with_stride_math_s_int(int *Ptr, short S) {
}

void column_major_load_array1(double Ptr[25]) {
// CHECK-LABEL: define void @column_major_load_array1(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_load_array1(double* %Ptr)
// CHECK: [[ADDR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call <25 x double> @llvm.matrix.column.major.load.v25f64(double* align 8 [[ADDR]], i64 5, i1 false, i32 5, i32 5)

dx5x5_t m = __builtin_matrix_column_major_load(Ptr, 5, 5, 5);
}

void column_major_load_array2() {
// CHECK-LABEL: define void @column_major_load_array2() #0 {
// CHECK-LABEL: define{{.*}} void @column_major_load_array2() #0 {
// CHECK-NEXT: entry:
// CHECK-NEXT: [[PTR:%.*]] = alloca [25 x double], align 16
// CHECK: [[ARRAY_DEC:%.*]] = getelementptr inbounds [25 x double], [25 x double]* [[PTR]], i64 0, i64 0
Expand All @@ -169,23 +169,23 @@ void column_major_load_array2() {
}

void column_major_load_const(const double *Ptr) {
// CHECK-LABEL: define void @column_major_load_const(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_load_const(double* %Ptr)
// CHECK: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call <25 x double> @llvm.matrix.column.major.load.v25f64(double* align 8 [[PTR]], i64 5, i1 false, i32 5, i32 5)

dx5x5_t m_a1 = __builtin_matrix_column_major_load(Ptr, 5, 5, 5);
}

void column_major_load_volatile(volatile double *Ptr) {
// CHECK-LABEL: define void @column_major_load_volatile(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_load_volatile(double* %Ptr)
// CHECK: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call <25 x double> @llvm.matrix.column.major.load.v25f64(double* align 8 [[PTR]], i64 5, i1 true, i32 5, i32 5)

dx5x5_t m_a1 = __builtin_matrix_column_major_load(Ptr, 5, 5, 5);
}

void column_major_store_with_const_stride_double(double *Ptr) {
// CHECK-LABEL: define void @column_major_store_with_const_stride_double(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_store_with_const_stride_double(double* %Ptr)
// CHECK: [[M:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call void @llvm.matrix.column.major.store.v25f64(<25 x double> [[M]], double* align 8 [[PTR]], i64 5, i1 false, i32 5, i32 5)
Expand All @@ -195,7 +195,7 @@ void column_major_store_with_const_stride_double(double *Ptr) {
}

void column_major_store_with_const_stride2_double(double *Ptr) {
// CHECK-LABEL: define void @column_major_store_with_const_stride2_double(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_store_with_const_stride2_double(double* %Ptr)
// CHECK: [[M:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call void @llvm.matrix.column.major.store.v25f64(<25 x double> [[M]], double* align 8 [[PTR]], i64 15, i1 false, i32 5, i32 5)
Expand All @@ -205,7 +205,7 @@ void column_major_store_with_const_stride2_double(double *Ptr) {
}

void column_major_store_with_stride_math_int(int *Ptr, int S) {
// CHECK-LABEL: define void @column_major_store_with_stride_math_int(i32* %Ptr, i32 %S)
// CHECK-LABEL: define{{.*}} void @column_major_store_with_stride_math_int(i32* %Ptr, i32 %S)
// CHECK: [[M:%.*]] = load <80 x i32>, <80 x i32>* {{.*}}, align 4
// CHECK-NEXT: [[PTR:%.*]] = load i32*, i32** %Ptr.addr, align 8
// CHECK-NEXT: [[S:%.*]] = load i32, i32* %S.addr, align 4
Expand All @@ -218,7 +218,7 @@ void column_major_store_with_stride_math_int(int *Ptr, int S) {
}

void column_major_store_with_stride_math_s_int(int *Ptr, short S) {
// CHECK-LABEL: define void @column_major_store_with_stride_math_s_int(i32* %Ptr, i16 signext %S)
// CHECK-LABEL: define{{.*}} void @column_major_store_with_stride_math_s_int(i32* %Ptr, i16 signext %S)
// CHECK: [[M:%.*]] = load <80 x i32>, <80 x i32>* {{.*}}, align 4
// CHECK-NEXT: [[PTR:%.*]] = load i32*, i32** %Ptr.addr, align 8
// CHECK-NEXT: [[S:%.*]] = load i16, i16* %S.addr, align 2
Expand All @@ -232,7 +232,7 @@ void column_major_store_with_stride_math_s_int(int *Ptr, short S) {
}

void column_major_store_array1(double Ptr[25]) {
// CHECK-LABEL: define void @column_major_store_array1(double* %Ptr)
// CHECK-LABEL: define{{.*}} void @column_major_store_array1(double* %Ptr)
// CHECK: [[M:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call void @llvm.matrix.column.major.store.v25f64(<25 x double> [[M]], double* align 8 [[PTR]], i64 5, i1 false, i32 5, i32 5)
Expand All @@ -242,7 +242,7 @@ void column_major_store_array1(double Ptr[25]) {
}

void column_major_store_array2() {
// CHECK-LABEL: define void @column_major_store_array2()
// CHECK-LABEL: define{{.*}} void @column_major_store_array2()
// CHECK: [[M:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[PTR:%.*]] = getelementptr inbounds [25 x double], [25 x double]* %Ptr, i64 0, i64 0
// CHECK-NEXT: call void @llvm.matrix.column.major.store.v25f64(<25 x double> [[M]], double* align 16 [[PTR]], i64 5, i1 false, i32 5, i32 5)
Expand All @@ -253,7 +253,7 @@ void column_major_store_array2() {
}

void column_major_store_volatile(volatile double *Ptr) {
// CHECK-LABEL: define void @column_major_store_volatile(double* %Ptr) #0 {
// CHECK-LABEL: define{{.*}} void @column_major_store_volatile(double* %Ptr) #0 {
// CHECK: [[M:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[PTR:%.*]] = load double*, double** %Ptr.addr, align 8
// CHECK-NEXT: call void @llvm.matrix.column.major.store.v25f64(<25 x double> [[M]], double* align 8 [[PTR]], i64 5, i1 true, i32 5, i32 5)
Expand Down
34 changes: 17 additions & 17 deletions clang/test/CodeGen/matrix-type-operators.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ typedef unsigned long long ullx4x2_t __attribute__((matrix_type(4, 2)));
// Floating point matrix/scalar additions.

void add_matrix_matrix_double(dx5x5_t a, dx5x5_t b, dx5x5_t c) {
// CHECK-LABEL: define void @add_matrix_matrix_double(<25 x double> %a, <25 x double> %b, <25 x double> %c)
// CHECK-LABEL: define{{.*}} void @add_matrix_matrix_double(<25 x double> %a, <25 x double> %b, <25 x double> %c)
// CHECK: [[B:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[C:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[RES:%.*]] = fadd <25 x double> [[B]], [[C]]
Expand All @@ -18,7 +18,7 @@ void add_matrix_matrix_double(dx5x5_t a, dx5x5_t b, dx5x5_t c) {
}

void add_matrix_matrix_float(fx2x3_t a, fx2x3_t b, fx2x3_t c) {
// CHECK-LABEL: define void @add_matrix_matrix_float(<6 x float> %a, <6 x float> %b, <6 x float> %c)
// CHECK-LABEL: define{{.*}} void @add_matrix_matrix_float(<6 x float> %a, <6 x float> %b, <6 x float> %c)
// CHECK: [[B:%.*]] = load <6 x float>, <6 x float>* {{.*}}, align 4
// CHECK-NEXT: [[C:%.*]] = load <6 x float>, <6 x float>* {{.*}}, align 4
// CHECK-NEXT: [[RES:%.*]] = fadd <6 x float> [[B]], [[C]]
Expand All @@ -28,7 +28,7 @@ void add_matrix_matrix_float(fx2x3_t a, fx2x3_t b, fx2x3_t c) {
}

void add_matrix_scalar_double_float(dx5x5_t a, float vf) {
// CHECK-LABEL: define void @add_matrix_scalar_double_float(<25 x double> %a, float %vf)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_double_float(<25 x double> %a, float %vf)
// CHECK: [[MATRIX:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[SCALAR:%.*]] = load float, float* %vf.addr, align 4
// CHECK-NEXT: [[SCALAR_EXT:%.*]] = fpext float [[SCALAR]] to double
Expand All @@ -41,7 +41,7 @@ void add_matrix_scalar_double_float(dx5x5_t a, float vf) {
}

void add_matrix_scalar_double_double(dx5x5_t a, double vd) {
// CHECK-LABEL: define void @add_matrix_scalar_double_double(<25 x double> %a, double %vd)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_double_double(<25 x double> %a, double %vd)
// CHECK: [[MATRIX:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 8
// CHECK-NEXT: [[SCALAR:%.*]] = load double, double* %vd.addr, align 8
// CHECK-NEXT: [[SCALAR_EMBED:%.*]] = insertelement <25 x double> poison, double [[SCALAR]], i32 0
Expand All @@ -53,7 +53,7 @@ void add_matrix_scalar_double_double(dx5x5_t a, double vd) {
}

void add_matrix_scalar_float_float(fx2x3_t b, float vf) {
// CHECK-LABEL: define void @add_matrix_scalar_float_float(<6 x float> %b, float %vf)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_float_float(<6 x float> %b, float %vf)
// CHECK: [[MATRIX:%.*]] = load <6 x float>, <6 x float>* {{.*}}, align 4
// CHECK-NEXT: [[SCALAR:%.*]] = load float, float* %vf.addr, align 4
// CHECK-NEXT: [[SCALAR_EMBED:%.*]] = insertelement <6 x float> poison, float [[SCALAR]], i32 0
Expand All @@ -65,7 +65,7 @@ void add_matrix_scalar_float_float(fx2x3_t b, float vf) {
}

void add_matrix_scalar_float_double(fx2x3_t b, double vd) {
// CHECK-LABEL: define void @add_matrix_scalar_float_double(<6 x float> %b, double %vd)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_float_double(<6 x float> %b, double %vd)
// CHECK: [[MATRIX:%.*]] = load <6 x float>, <6 x float>* {{.*}}, align 4
// CHECK-NEXT: [[SCALAR:%.*]] = load double, double* %vd.addr, align 8
// CHECK-NEXT: [[SCALAR_TRUNC:%.*]] = fptrunc double [[SCALAR]] to float
Expand All @@ -80,7 +80,7 @@ void add_matrix_scalar_float_double(fx2x3_t b, double vd) {
// Integer matrix/scalar additions

void add_matrix_matrix_int(ix9x3_t a, ix9x3_t b, ix9x3_t c) {
// CHECK-LABEL: define void @add_matrix_matrix_int(<27 x i32> %a, <27 x i32> %b, <27 x i32> %c)
// CHECK-LABEL: define{{.*}} void @add_matrix_matrix_int(<27 x i32> %a, <27 x i32> %b, <27 x i32> %c)
// CHECK: [[B:%.*]] = load <27 x i32>, <27 x i32>* {{.*}}, align 4
// CHECK-NEXT: [[C:%.*]] = load <27 x i32>, <27 x i32>* {{.*}}, align 4
// CHECK-NEXT: [[RES:%.*]] = add <27 x i32> [[B]], [[C]]
Expand All @@ -89,7 +89,7 @@ void add_matrix_matrix_int(ix9x3_t a, ix9x3_t b, ix9x3_t c) {
}

void add_matrix_matrix_unsigned_long_long(ullx4x2_t a, ullx4x2_t b, ullx4x2_t c) {
// CHECK-LABEL: define void @add_matrix_matrix_unsigned_long_long(<8 x i64> %a, <8 x i64> %b, <8 x i64> %c)
// CHECK-LABEL: define{{.*}} void @add_matrix_matrix_unsigned_long_long(<8 x i64> %a, <8 x i64> %b, <8 x i64> %c)
// CHECK: [[B:%.*]] = load <8 x i64>, <8 x i64>* {{.*}}, align 8
// CHECK-NEXT: [[C:%.*]] = load <8 x i64>, <8 x i64>* {{.*}}, align 8
// CHECK-NEXT: [[RES:%.*]] = add <8 x i64> [[B]], [[C]]
Expand All @@ -99,7 +99,7 @@ void add_matrix_matrix_unsigned_long_long(ullx4x2_t a, ullx4x2_t b, ullx4x2_t c)
}

void add_matrix_scalar_int_short(ix9x3_t a, short vs) {
// CHECK-LABEL: define void @add_matrix_scalar_int_short(<27 x i32> %a, i16 signext %vs)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_int_short(<27 x i32> %a, i16 signext %vs)
// CHECK: [[MATRIX:%.*]] = load <27 x i32>, <27 x i32>* [[MAT_ADDR:%.*]], align 4
// CHECK-NEXT: [[SCALAR:%.*]] = load i16, i16* %vs.addr, align 2
// CHECK-NEXT: [[SCALAR_EXT:%.*]] = sext i16 [[SCALAR]] to i32
Expand All @@ -112,7 +112,7 @@ void add_matrix_scalar_int_short(ix9x3_t a, short vs) {
}

void add_matrix_scalar_int_long_int(ix9x3_t a, long int vli) {
// CHECK-LABEL: define void @add_matrix_scalar_int_long_int(<27 x i32> %a, i64 %vli)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_int_long_int(<27 x i32> %a, i64 %vli)
// CHECK: [[MATRIX:%.*]] = load <27 x i32>, <27 x i32>* [[MAT_ADDR:%.*]], align 4
// CHECK-NEXT: [[SCALAR:%.*]] = load i64, i64* %vli.addr, align 8
// CHECK-NEXT: [[SCALAR_TRUNC:%.*]] = trunc i64 [[SCALAR]] to i32
Expand All @@ -125,7 +125,7 @@ void add_matrix_scalar_int_long_int(ix9x3_t a, long int vli) {
}

void add_matrix_scalar_int_unsigned_long_long(ix9x3_t a, unsigned long long int vulli) {
// CHECK-LABEL: define void @add_matrix_scalar_int_unsigned_long_long(<27 x i32> %a, i64 %vulli)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_int_unsigned_long_long(<27 x i32> %a, i64 %vulli)
// CHECK: [[MATRIX:%.*]] = load <27 x i32>, <27 x i32>* [[MAT_ADDR:%.*]], align 4
// CHECK-NEXT: [[SCALAR:%.*]] = load i64, i64* %vulli.addr, align 8
// CHECK-NEXT: [[SCALAR_TRUNC:%.*]] = trunc i64 [[SCALAR]] to i32
Expand All @@ -138,7 +138,7 @@ void add_matrix_scalar_int_unsigned_long_long(ix9x3_t a, unsigned long long int
}

void add_matrix_scalar_long_long_int_short(ullx4x2_t b, short vs) {
// CHECK-LABEL: define void @add_matrix_scalar_long_long_int_short(<8 x i64> %b, i16 signext %vs)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_long_long_int_short(<8 x i64> %b, i16 signext %vs)
// CHECK: [[SCALAR:%.*]] = load i16, i16* %vs.addr, align 2
// CHECK-NEXT: [[SCALAR_EXT:%.*]] = sext i16 [[SCALAR]] to i64
// CHECK-NEXT: [[MATRIX:%.*]] = load <8 x i64>, <8 x i64>* {{.*}}, align 8
Expand All @@ -151,7 +151,7 @@ void add_matrix_scalar_long_long_int_short(ullx4x2_t b, short vs) {
}

void add_matrix_scalar_long_long_int_int(ullx4x2_t b, long int vli) {
// CHECK-LABEL: define void @add_matrix_scalar_long_long_int_int(<8 x i64> %b, i64 %vli)
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_long_long_int_int(<8 x i64> %b, i64 %vli)
// CHECK: [[SCALAR:%.*]] = load i64, i64* %vli.addr, align 8
// CHECK-NEXT: [[MATRIX:%.*]] = load <8 x i64>, <8 x i64>* {{.*}}, align 8
// CHECK-NEXT: [[SCALAR_EMBED:%.*]] = insertelement <8 x i64> poison, i64 [[SCALAR]], i32 0
Expand All @@ -163,7 +163,7 @@ void add_matrix_scalar_long_long_int_int(ullx4x2_t b, long int vli) {
}

void add_matrix_scalar_long_long_int_unsigned_long_long(ullx4x2_t b, unsigned long long int vulli) {
// CHECK-LABEL: define void @add_matrix_scalar_long_long_int_unsigned_long_long
// CHECK-LABEL: define{{.*}} void @add_matrix_scalar_long_long_int_unsigned_long_long
// CHECK: [[SCALAR:%.*]] = load i64, i64* %vulli.addr, align 8
// CHECK-NEXT: [[MATRIX:%.*]] = load <8 x i64>, <8 x i64>* %0, align 8
// CHECK-NEXT: [[SCALAR_EMBED:%.*]] = insertelement <8 x i64> poison, i64 [[SCALAR]], i32 0
Expand Down Expand Up @@ -519,7 +519,7 @@ void insert_extract(dx5x5_t a, fx3x3_t b, unsigned long j, short k) {
}

void insert_compound_stmt(dx5x5_t a) {
// CHECK-LABEL: define void @insert_compound_stmt(<25 x double> %a)
// CHECK-LABEL: define{{.*}} void @insert_compound_stmt(<25 x double> %a)
// CHECK: [[A:%.*]] = load <25 x double>, <25 x double>* [[A_PTR:%.*]], align 8
// CHECK-NEXT: [[EXT:%.*]] = extractelement <25 x double> [[A]], i64 17
// CHECK-NEXT: [[SUB:%.*]] = fsub double [[EXT]], 1.000000e+00
Expand All @@ -536,7 +536,7 @@ struct Foo {
};

void insert_compound_stmt_field(struct Foo *a, float f, unsigned i, unsigned j) {
// CHECK-LABEL: define void @insert_compound_stmt_field(%struct.Foo* %a, float %f, i32 %i, i32 %j)
// CHECK-LABEL: define{{.*}} void @insert_compound_stmt_field(%struct.Foo* %a, float %f, i32 %i, i32 %j)
// CHECK: [[I:%.*]] = load i32, i32* %i.addr, align 4
// CHECK-NEXT: [[I_EXT:%.*]] = zext i32 [[I]] to i64
// CHECK-NEXT: [[J:%.*]] = load i32, i32* %j.addr, align 4
Expand All @@ -556,7 +556,7 @@ void insert_compound_stmt_field(struct Foo *a, float f, unsigned i, unsigned j)
}

void matrix_as_idx(ix9x3_t a, int i, int j, dx5x5_t b) {
// CHECK-LABEL: define void @matrix_as_idx(<27 x i32> %a, i32 %i, i32 %j, <25 x double> %b)
// CHECK-LABEL: define{{.*}} void @matrix_as_idx(<27 x i32> %a, i32 %i, i32 %j, <25 x double> %b)
// CHECK: [[I1:%.*]] = load i32, i32* %i.addr, align 4
// CHECK-NEXT: [[I1_EXT:%.*]] = sext i32 [[I1]] to i64
// CHECK-NEXT: [[J1:%.*]] = load i32, i32* %j.addr, align 4
Expand Down
18 changes: 9 additions & 9 deletions clang/test/CodeGen/matrix-type.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ typedef double dx5x5_t __attribute__((matrix_type(5, 5)));
// CHECK: %struct.Matrix = type { i8, [12 x float], float }

void load_store_double(dx5x5_t *a, dx5x5_t *b) {
// CHECK-LABEL: define void @load_store_double(
// CHECK-LABEL: define{{.*}} void @load_store_double(
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca [25 x double]*, align 8
// CHECK-NEXT: %b.addr = alloca [25 x double]*, align 8
Expand All @@ -28,7 +28,7 @@ void load_store_double(dx5x5_t *a, dx5x5_t *b) {

typedef float fx3x4_t __attribute__((matrix_type(3, 4)));
void load_store_float(fx3x4_t *a, fx3x4_t *b) {
// CHECK-LABEL: define void @load_store_float(
// CHECK-LABEL: define{{.*}} void @load_store_float(
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca [12 x float]*, align 8
// CHECK-NEXT: %b.addr = alloca [12 x float]*, align 8
Expand All @@ -47,7 +47,7 @@ void load_store_float(fx3x4_t *a, fx3x4_t *b) {

typedef int ix3x4_t __attribute__((matrix_type(4, 3)));
void load_store_int(ix3x4_t *a, ix3x4_t *b) {
// CHECK-LABEL: define void @load_store_int(
// CHECK-LABEL: define{{.*}} void @load_store_int(
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca [12 x i32]*, align 8
// CHECK-NEXT: %b.addr = alloca [12 x i32]*, align 8
Expand All @@ -66,7 +66,7 @@ void load_store_int(ix3x4_t *a, ix3x4_t *b) {

typedef unsigned long long ullx3x4_t __attribute__((matrix_type(4, 3)));
void load_store_ull(ullx3x4_t *a, ullx3x4_t *b) {
// CHECK-LABEL: define void @load_store_ull(
// CHECK-LABEL: define{{.*}} void @load_store_ull(
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca [12 x i64]*, align 8
// CHECK-NEXT: %b.addr = alloca [12 x i64]*, align 8
Expand All @@ -85,7 +85,7 @@ void load_store_ull(ullx3x4_t *a, ullx3x4_t *b) {

typedef __fp16 fp16x3x4_t __attribute__((matrix_type(4, 3)));
void load_store_fp16(fp16x3x4_t *a, fp16x3x4_t *b) {
// CHECK-LABEL: define void @load_store_fp16(
// CHECK-LABEL: define{{.*}} void @load_store_fp16(
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca [12 x half]*, align 8
// CHECK-NEXT: %b.addr = alloca [12 x half]*, align 8
Expand All @@ -105,7 +105,7 @@ void load_store_fp16(fp16x3x4_t *a, fp16x3x4_t *b) {
typedef float fx3x3_t __attribute__((matrix_type(3, 3)));

void parameter_passing(fx3x3_t a, fx3x3_t *b) {
// CHECK-LABEL: define void @parameter_passing(
// CHECK-LABEL: define{{.*}} void @parameter_passing(
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca [9 x float], align 4
// CHECK-NEXT: %b.addr = alloca [9 x float]*, align 8
Expand All @@ -121,7 +121,7 @@ void parameter_passing(fx3x3_t a, fx3x3_t *b) {
}

fx3x3_t return_matrix(fx3x3_t *a) {
// CHECK-LABEL: define <9 x float> @return_matrix
// CHECK-LABEL: define{{.*}} <9 x float> @return_matrix
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca [9 x float]*, align 8
// CHECK-NEXT: store [9 x float]* %a, [9 x float]** %a.addr, align 8
Expand All @@ -139,7 +139,7 @@ typedef struct {
} Matrix;

void matrix_struct(Matrix *a, Matrix *b) {
// CHECK-LABEL: define void @matrix_struct(
// CHECK-LABEL: define{{.*}} void @matrix_struct(
// CHECK-NEXT: entry:
// CHECK-NEXT: %a.addr = alloca %struct.Matrix*, align 8
// CHECK-NEXT: %b.addr = alloca %struct.Matrix*, align 8
Expand All @@ -159,7 +159,7 @@ void matrix_struct(Matrix *a, Matrix *b) {

typedef double dx4x4_t __attribute__((matrix_type(4, 4)));
void matrix_inline_asm_memory_readwrite() {
// CHECK-LABEL: define void @matrix_inline_asm_memory_readwrite()
// CHECK-LABEL: define{{.*}} void @matrix_inline_asm_memory_readwrite()
// CHECK-NEXT: entry:
// CHECK-NEXT: [[ALLOCA:%.+]] = alloca [16 x double], align 8
// CHECK-NEXT: [[PTR1:%.+]] = bitcast [16 x double]* [[ALLOCA]] to <16 x double>*
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/mms-bitfields.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ union HEADER {
struct Inner variable = { 1,0,1, 21 };
union HEADER hdr = {{1,2,3,4}};

// CHECK: @variable = global { i8, [3 x i8], i8, i8, i8, i8 } { i8 5, [3 x i8] undef, i8 21, i8 0, i8 0, i8 0 }, align 1
// CHECK: @hdr = global { { i8, i8, [2 x i8], i8, i8, i8, i8, i8, [3 x i8] } } { { i8, i8, [2 x i8], i8, i8, i8, i8, i8, [3 x i8] } { i8 8, i8 0, [2 x i8] undef, i8 2, i8 0, i8 0, i8 3, i8 4, [3 x i8] undef } }, align 1
// CHECK: @variable ={{.*}} global { i8, [3 x i8], i8, i8, i8, i8 } { i8 5, [3 x i8] undef, i8 21, i8 0, i8 0, i8 0 }, align 1
// CHECK: @hdr ={{.*}} global { { i8, i8, [2 x i8], i8, i8, i8, i8, i8, [3 x i8] } } { { i8, i8, [2 x i8], i8, i8, i8, i8, i8, [3 x i8] } { i8 8, i8 0, [2 x i8] undef, i8 2, i8 0, i8 0, i8 3, i8 4, [3 x i8] undef } }, align 1
2 changes: 1 addition & 1 deletion clang/test/CodeGen/ms-inline-asm-align.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ void align_test() {
__asm ALIGN 256;
}

// DARWIN-LABEL: define void @align_test()
// DARWIN-LABEL: define{{.*}} void @align_test()
// DARWIN: call void asm sideeffect inteldialect
// DARWIN-SAME: .align 3
// DARWIN-SAME: .align 4
Expand Down
50 changes: 25 additions & 25 deletions clang/test/CodeGen/ms-inline-asm.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ void t13() {
short j = 2;
__asm movzx eax, i
__asm movzx eax, j
// CHECK-LABEL: define void @t13()
// CHECK-LABEL: define{{.*}} void @t13()
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: movzx eax, byte ptr $0
// CHECK-SAME: movzx eax, word ptr $1
Expand All @@ -160,7 +160,7 @@ void t13_brac() {
short j = 2;
__asm movzx eax, [i]
__asm movzx eax, [j]
// CHECK-LABEL: define void @t13_brac()
// CHECK-LABEL: define{{.*}} void @t13_brac()
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: movzx eax, byte ptr $0
// CHECK-SAME: movzx eax, word ptr $1
Expand Down Expand Up @@ -526,7 +526,7 @@ void t38() {

void cpuid() {
__asm cpuid
// CHECK-LABEL: define void @cpuid
// CHECK-LABEL: define{{.*}} void @cpuid
// CHECK: call void asm sideeffect inteldialect "cpuid", "~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
}

Expand All @@ -548,7 +548,7 @@ typedef struct {
} C, *pC;

void t39() {
// CHECK-LABEL: define void @t39
// CHECK-LABEL: define{{.*}} void @t39
__asm mov eax, [eax].A.b
// CHECK: mov eax, [eax + $$4]
__asm mov eax, [eax] A.b
Expand All @@ -571,7 +571,7 @@ void t39() {
}

void t40(float a) {
// CHECK-LABEL: define void @t40
// CHECK-LABEL: define{{.*}} void @t40
int i;
__asm fld a
// CHECK: fld dword ptr $1
Expand All @@ -581,7 +581,7 @@ void t40(float a) {
}

void t41(unsigned short a) {
// CHECK-LABEL: define void @t41(i16 zeroext %a)
// CHECK-LABEL: define{{.*}} void @t41(i16 zeroext %a)
__asm mov cs, a;
// CHECK: mov cs, $0
__asm mov ds, a;
Expand All @@ -598,23 +598,23 @@ void t41(unsigned short a) {
}

void t42() {
// CHECK-LABEL: define void @t42(
// CHECK-LABEL: define{{.*}} void @t42(
int flags;
__asm mov flags, eax
// CHECK: mov $0, eax
// CHECK: "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %flags)
}

void t42b() {
// CHECK-LABEL: define void @t42b(
// CHECK-LABEL: define{{.*}} void @t42b(
int mxcsr;
__asm mov mxcsr, eax
// CHECK: mov $0, eax
// CHECK: "=*m,~{dirflag},~{fpsr},~{flags}"(i32* %mxcsr)
}

void t43() {
// CHECK-LABEL: define void @t43
// CHECK-LABEL: define{{.*}} void @t43
C strct;
// Work around PR20368: These should be single line blocks
__asm { mov eax, 4[strct.c1] }
Expand Down Expand Up @@ -646,7 +646,7 @@ void t43() {
}

void t44() {
// CHECK-LABEL: define void @t44
// CHECK-LABEL: define{{.*}} void @t44
__asm {
mov cr0, eax
mov cr2, ebx
Expand All @@ -657,7 +657,7 @@ void t44() {
}

void t45() {
// CHECK-LABEL: define void @t45
// CHECK-LABEL: define{{.*}} void @t45
__asm {
mov dr0, eax
mov dr1, ebx
Expand All @@ -670,13 +670,13 @@ void t45() {
}

void t46() {
// CHECK-LABEL: define void @t46
// CHECK-LABEL: define{{.*}} void @t46
__asm add eax, -128[eax]
// CHECK: call void asm sideeffect inteldialect "add eax, [eax + $$-128]", "~{eax},~{flags},~{dirflag},~{fpsr},~{flags}"()
}

void t47() {
// CHECK-LABEL: define void @t47
// CHECK-LABEL: define{{.*}} void @t47
__asm {
bndmk bnd0, dword ptr [eax]
bndmk bnd1, dword ptr [ebx]
Expand All @@ -687,29 +687,29 @@ void t47() {
}

void dot_operator(){
// CHECK-LABEL: define void @dot_operator
// CHECK-LABEL: define{{.*}} void @dot_operator
__asm { mov eax, 3[ebx]A.b}
// CHECK: call void asm sideeffect inteldialect "mov eax, [ebx + $$7]", "~{eax},~{dirflag},~{fpsr},~{flags}"
}

void call_clobber() {
__asm call t41
// CHECK-LABEL: define void @call_clobber
// CHECK-LABEL: define{{.*}} void @call_clobber
// CHECK: call void asm sideeffect inteldialect "call dword ptr ${0:P}", "*m,~{dirflag},~{fpsr},~{flags}"(void (i16)* @t41)
}

void xgetbv() {
__asm xgetbv
}
// CHECK-LABEL: define void @xgetbv()
// CHECK-LABEL: define{{.*}} void @xgetbv()
// CHECK: call void asm sideeffect inteldialect "xgetbv", "~{eax},~{edx},~{dirflag},~{fpsr},~{flags}"()

void label1() {
__asm {
label:
jmp label
}
// CHECK-LABEL: define void @label1()
// CHECK-LABEL: define{{.*}} void @label1()
// CHECK: call void asm sideeffect inteldialect "{{.*}}__MSASMLABEL_.${:uid}__label:\0A\09jmp {{.*}}__MSASMLABEL_.${:uid}__label", "~{dirflag},~{fpsr},~{flags}"() [[ATTR1:#[0-9]+]]
}

Expand All @@ -718,7 +718,7 @@ void label2() {
jmp label
label:
}
// CHECK-LABEL: define void @label2
// CHECK-LABEL: define{{.*}} void @label2
// CHECK: call void asm sideeffect inteldialect "jmp {{.*}}__MSASMLABEL_.${:uid}__label\0A\09{{.*}}__MSASMLABEL_.${:uid}__label:", "~{dirflag},~{fpsr},~{flags}"()
}

Expand All @@ -727,7 +727,7 @@ void label3() {
label:
mov eax, label
}
// CHECK-LABEL: define void @label3
// CHECK-LABEL: define{{.*}} void @label3
// CHECK: call void asm sideeffect inteldialect "{{.*}}__MSASMLABEL_.${:uid}__label:\0A\09mov eax, {{.*}}__MSASMLABEL_.${:uid}__label", "~{eax},~{dirflag},~{fpsr},~{flags}"()
}

Expand All @@ -736,7 +736,7 @@ void label4() {
label:
mov eax, [label]
}
// CHECK-LABEL: define void @label4
// CHECK-LABEL: define{{.*}} void @label4
// CHECK: call void asm sideeffect inteldialect "{{.*}}__MSASMLABEL_.${:uid}__label:\0A\09mov eax, {{.*}}__MSASMLABEL_.${:uid}__label", "~{eax},~{dirflag},~{fpsr},~{flags}"()
}

Expand All @@ -745,7 +745,7 @@ void label5() {
jmp dollar_label$
dollar_label$:
}
// CHECK-LABEL: define void @label5
// CHECK-LABEL: define{{.*}} void @label5
// CHECK: call void asm sideeffect inteldialect "jmp {{.*}}__MSASMLABEL_.${:uid}__dollar_label$$\0A\09{{.*}}__MSASMLABEL_.${:uid}__dollar_label$$:", "~{dirflag},~{fpsr},~{flags}"()
}

Expand All @@ -756,7 +756,7 @@ void label6(){
jz short label
label:
}
// CHECK-LABEL: define void @label6
// CHECK-LABEL: define{{.*}} void @label6
// CHECK: jmp {{.*}}__MSASMLABEL_.${:uid}__label\0A\09jc {{.*}}__MSASMLABEL_.${:uid}__label\0A\09jz {{.*}}__MSASMLABEL_.${:uid}__label\0A\09{{.*}}__MSASMLABEL_.${:uid}__label:"
}

Expand All @@ -765,14 +765,14 @@ void mxcsr() {
char buf[4096];
__asm fxrstor buf
}
// CHECK-LABEL: define void @mxcsr
// CHECK-LABEL: define{{.*}} void @mxcsr
// CHECK: call void asm sideeffect inteldialect "fxrstor $0", "=*m,~{fpcr},~{dirflag},~{fpsr},~{flags}"

// Make sure we can find the register for the dirflag for popfd
void dirflag() {
__asm popfd
}
// CHECK-LABEL: define void @dirflag
// CHECK-LABEL: define{{.*}} void @dirflag
// CHECK: call void asm sideeffect inteldialect "popfd", "~{dirflag},~{flags},~{esp},~{dirflag},~{fpsr},~{flags}"

typedef union _LARGE_INTEGER {
Expand All @@ -790,7 +790,7 @@ typedef union _LARGE_INTEGER {
int test_indirect_field(LARGE_INTEGER LargeInteger) {
__asm mov eax, LargeInteger.LowPart
}
// CHECK-LABEL: define i32 @test_indirect_field(
// CHECK-LABEL: define{{.*}} i32 @test_indirect_field(
// CHECK: call i32 asm sideeffect inteldialect "mov eax, $1",

// MS ASM containing labels must not be duplicated (PR23715).
Expand Down
20 changes: 10 additions & 10 deletions clang/test/CodeGen/ms-inline-asm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct Foo {
};

void t1() {
// CHECK-LABEL: define void @_Z2t1v()
// CHECK-LABEL: define{{.*}} void @_Z2t1v()
Foo::ptr = (int *)0xDEADBEEF;
Foo::Bar::ptr = (int *)0xDEADBEEF;
// CHECK: call void asm sideeffect inteldialect
Expand All @@ -36,14 +36,14 @@ void t2() {
int lvar = 10;
__asm mov eax, offset Foo::ptr
__asm mov eax, offset Foo::Bar::ptr
// CHECK-LABEL: define void @_Z2t2v()
// CHECK-LABEL: define{{.*}} void @_Z2t2v()
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: mov eax, $0
// CHECK-SAME: mov eax, $1
// CHECK-SAME: "i,i,~{eax},~{dirflag},~{fpsr},~{flags}"(i32** @_ZN3Foo3ptrE, i32** @_ZN3Foo3Bar3ptrE)
}

// CHECK-LABEL: define void @_Z2t3v()
// CHECK-LABEL: define{{.*}} void @_Z2t3v()
void t3() {
__asm mov eax, LENGTH Foo::ptr
__asm mov eax, LENGTH Foo::Bar::ptr
Expand Down Expand Up @@ -82,7 +82,7 @@ struct T4 {
void test();
};

// CHECK-LABEL: define void @_ZN2T44testEv(
// CHECK-LABEL: define{{.*}} void @_ZN2T44testEv(
void T4::test() {
// CHECK: [[T0:%.*]] = alloca [[T4:%.*]]*,
// CHECK: [[THIS:%.*]] = load [[T4]]*, [[T4]]** [[T0]]
Expand All @@ -99,7 +99,7 @@ template <class T> struct T5 {
template <class U> static T create(U);
void run();
};
// CHECK-LABEL: define void @_Z5test5v()
// CHECK-LABEL: define{{.*}} void @_Z5test5v()
void test5() {
// CHECK: [[X:%.*]] = alloca i32
// CHECK: [[Y:%.*]] = alloca i32
Expand Down Expand Up @@ -128,7 +128,7 @@ void t7_struct() {
int b;
};
__asm mov eax, [eax].A.b
// CHECK-LABEL: define void @_Z9t7_structv
// CHECK-LABEL: define{{.*}} void @_Z9t7_structv
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: mov eax, [eax + $$4]
// CHECK-SAME: "~{eax},~{dirflag},~{fpsr},~{flags}"()
Expand All @@ -140,7 +140,7 @@ void t7_typedef() {
int b;
} A;
__asm mov eax, [eax].A.b
// CHECK-LABEL: define void @_Z10t7_typedefv
// CHECK-LABEL: define{{.*}} void @_Z10t7_typedefv
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: mov eax, [eax + $$4]
// CHECK-SAME: "~{eax},~{dirflag},~{fpsr},~{flags}"()
Expand All @@ -152,15 +152,15 @@ void t7_using() {
int b;
};
__asm mov eax, [eax].A.b
// CHECK-LABEL: define void @_Z8t7_usingv
// CHECK-LABEL: define{{.*}} void @_Z8t7_usingv
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: mov eax, [eax + $$4]
// CHECK-SAME: "~{eax},~{dirflag},~{fpsr},~{flags}"()
}

void t8() {
__asm some_label:
// CHECK-LABEL: define void @_Z2t8v()
// CHECK-LABEL: define{{.*}} void @_Z2t8v()
// CHECK: call void asm sideeffect inteldialect
// CHECK-SAME: L__MSASMLABEL_.${:uid}__some_label:
// CHECK-SAME: "~{dirflag},~{fpsr},~{flags}"()
Expand All @@ -181,7 +181,7 @@ void t8() {
}

void t9() {
// CHECK-LABEL: define void @_Z2t9v()
// CHECK-LABEL: define{{.*}} void @_Z2t9v()
struct A {
int a;
int b;
Expand Down
52 changes: 26 additions & 26 deletions clang/test/CodeGen/ms_struct-bitfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ struct
char bar;
} ATTR t1;
int s1 = sizeof(t1);
// CHECK: @s1 = global i32 2
// CHECK-ARM: @s1 = global i32 2
// CHECK: @s1 ={{.*}} global i32 2
// CHECK-ARM: @s1 ={{.*}} global i32 2

struct
{
Expand All @@ -27,8 +27,8 @@ struct
char bar;
} ATTR t2;
int s2 = sizeof(t2);
// CHECK: @s2 = global i32 2
// CHECK-ARM: @s2 = global i32 2
// CHECK: @s2 ={{.*}} global i32 2
// CHECK-ARM: @s2 ={{.*}} global i32 2

struct
{
Expand All @@ -41,17 +41,17 @@ struct
char : 0;
} ATTR t3;
int s3 = sizeof(t3);
// CHECK: @s3 = global i32 2
// CHECK-ARM: @s3 = global i32 2
// CHECK: @s3 ={{.*}} global i32 2
// CHECK-ARM: @s3 ={{.*}} global i32 2

struct
{
long : 0;
char bar;
} ATTR t4;
int s4 = sizeof(t4);
// CHECK: @s4 = global i32 1
// CHECK-ARM: @s4 = global i32 1
// CHECK: @s4 ={{.*}} global i32 1
// CHECK-ARM: @s4 ={{.*}} global i32 1

struct
{
Expand All @@ -61,8 +61,8 @@ struct
char bar;
} ATTR t5;
int s5 = sizeof(t5);
// CHECK: @s5 = global i32 1
// CHECK-ARM: @s5 = global i32 1
// CHECK: @s5 ={{.*}} global i32 1
// CHECK-ARM: @s5 ={{.*}} global i32 1

struct
{
Expand All @@ -72,8 +72,8 @@ struct
char bar;
} ATTR t6;
int s6 = sizeof(t6);
// CHECK: @s6 = global i32 1
// CHECK-ARM: @s6 = global i32 1
// CHECK: @s6 ={{.*}} global i32 1
// CHECK-ARM: @s6 ={{.*}} global i32 1

struct
{
Expand All @@ -93,8 +93,8 @@ struct
char bar7;
} ATTR t7;
int s7 = sizeof(t7);
// CHECK: @s7 = global i32 9
// CHECK-ARM: @s7 = global i32 9
// CHECK: @s7 ={{.*}} global i32 9
// CHECK-ARM: @s7 ={{.*}} global i32 9

struct
{
Expand All @@ -103,8 +103,8 @@ struct
char : 0;
} ATTR t8;
int s8 = sizeof(t8);
// CHECK: @s8 = global i32 0
// CHECK-ARM: @s8 = global i32 0
// CHECK: @s8 ={{.*}} global i32 0
// CHECK-ARM: @s8 ={{.*}} global i32 0

struct
{
Expand Down Expand Up @@ -136,8 +136,8 @@ struct
char :4;
} ATTR t9;
int s9 = sizeof(t9);
// CHECK: @s9 = global i32 28
// CHECK-ARM: @s9 = global i32 28
// CHECK: @s9 ={{.*}} global i32 28
// CHECK-ARM: @s9 ={{.*}} global i32 28

struct
{
Expand All @@ -146,8 +146,8 @@ struct
char bar;
} ATTR t10;
int s10 = sizeof(t10);
// CHECK: @s10 = global i32 16
// CHECK-ARM: @s10 = global i32 8
// CHECK: @s10 ={{.*}} global i32 16
// CHECK-ARM: @s10 ={{.*}} global i32 8

// rdar://16041826 - ensure that ms_structs work correctly on a
// !useBitFieldTypeAlignment() target
Expand All @@ -157,23 +157,23 @@ struct {
unsigned int c;
} ATTR t11;
int s11 = sizeof(t11);
// CHECK: @s11 = global i32 12
// CHECK-ARM: @s11 = global i32 12
// CHECK: @s11 ={{.*}} global i32 12
// CHECK-ARM: @s11 ={{.*}} global i32 12

struct {
unsigned char a : 3;
unsigned char b : 4;
unsigned short c : 6;
} ATTR t12;
int s12 = sizeof(t12);
// CHECK: @s12 = global i32 4
// CHECK-ARM: @s12 = global i32 4
// CHECK: @s12 ={{.*}} global i32 4
// CHECK-ARM: @s12 ={{.*}} global i32 4

struct {
unsigned char a : 3;
unsigned char b : 4;
__attribute__((packed)) unsigned short c : 6;
} ATTR t13;
int s13 = sizeof(t13);
// CHECK: @s13 = global i32 4
// CHECK-ARM: @s13 = global i32 4
// CHECK: @s13 ={{.*}} global i32 4
// CHECK-ARM: @s13 ={{.*}} global i32 4
2 changes: 1 addition & 1 deletion clang/test/CodeGen/no-bitfield-type-align.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct S {
unsigned short f2:15;
};

// CHECK: define void @test_zero_width_bitfield(%[[STRUCT_S]]* %[[A:.*]])
// CHECK: define{{.*}} void @test_zero_width_bitfield(%[[STRUCT_S]]* %[[A:.*]])
// CHECK: %[[BF_LOAD:.*]] = load i32, i32* %[[V1:.*]], align 1
// CHECK: %[[BF_CLEAR:.*]] = and i32 %[[BF_LOAD]], 32767
// CHECK: %[[BF_CAST:.*]] = trunc i32 %[[BF_CLEAR]] to i16
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/no-opt-volatile-memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void foo (void) {
gs = gs;
ls = gs;
}
// CHECK-LABEL: define void @foo()
// CHECK-LABEL: define{{.*}} void @foo()
// CHECK: %[[LS:.*]] = alloca %struct.s, align 4
// CHECK-NEXT: %[[ZERO:.*]] = bitcast %struct.s* %[[LS]] to i8*
// CHECK-NEXT: %[[ONE:.*]] = bitcast %struct.s* %[[LS]] to i8*
Expand All @@ -34,7 +34,7 @@ void fee (void) {
s = s;
s.y = gs;
}
// CHECK-LABEL: define void @fee()
// CHECK-LABEL: define{{.*}} void @fee()
// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i64 132, i1 true)
// CHECK-NEXT: call void @llvm.memcpy.{{.*}}(i8* align 4 getelementptr inbounds (%struct.s1, %struct.s1* @s, i32 0, i32 0, i32 0, i32 0), i8* align 4 getelementptr inbounds (%struct.s, %struct.s* @gs, i32 0, i32 0, i32 0), i64 132, i1 true)

36 changes: 18 additions & 18 deletions clang/test/CodeGen/nonnull.c
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm < %s | FileCheck -check-prefix=NULL-INVALID %s
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -fno-delete-null-pointer-checks < %s | FileCheck -check-prefix=NULL-VALID %s

// NULL-INVALID: define void @foo(i32* nonnull %x)
// NULL-VALID: define void @foo(i32* %x)
// NULL-INVALID: define{{.*}} void @foo(i32* nonnull %x)
// NULL-VALID: define{{.*}} void @foo(i32* %x)
void foo(int * __attribute__((nonnull)) x) {
*x = 0;
}

// NULL-INVALID: define void @bar(i32* nonnull %x)
// NULL-VALID: define void @bar(i32* %x)
// NULL-INVALID: define{{.*}} void @bar(i32* nonnull %x)
// NULL-VALID: define{{.*}} void @bar(i32* %x)
void bar(int * x) __attribute__((nonnull(1))) {
*x = 0;
}

// NULL-INVALID: define void @bar2(i32* %x, i32* nonnull %y)
// NULL-VALID: define void @bar2(i32* %x, i32* %y)
// NULL-INVALID: define{{.*}} void @bar2(i32* %x, i32* nonnull %y)
// NULL-VALID: define{{.*}} void @bar2(i32* %x, i32* %y)
void bar2(int * x, int * y) __attribute__((nonnull(2))) {
*x = 0;
}

static int a;
// NULL-INVALID: define nonnull i32* @bar3()
// NULL-VALID: define i32* @bar3()
// NULL-INVALID: define{{.*}} nonnull i32* @bar3()
// NULL-VALID: define{{.*}} i32* @bar3()
int * bar3() __attribute__((returns_nonnull)) {
return &a;
}

// NULL-INVALID: define i32 @bar4(i32 %n, i32* nonnull %p)
// NULL-VALID: define i32 @bar4(i32 %n, i32* %p)
// NULL-INVALID: define{{.*}} i32 @bar4(i32 %n, i32* nonnull %p)
// NULL-VALID: define{{.*}} i32 @bar4(i32 %n, i32* %p)
int bar4(int n, int *p) __attribute__((nonnull)) {
return n + *p;
}

// NULL-INVALID: define i32 @bar5(i32 %n, i32* nonnull %p)
// NULL-VALID: define i32 @bar5(i32 %n, i32* %p)
// NULL-INVALID: define{{.*}} i32 @bar5(i32 %n, i32* nonnull %p)
// NULL-VALID: define{{.*}} i32 @bar5(i32 %n, i32* %p)
int bar5(int n, int *p) __attribute__((nonnull(1, 2))) {
return n + *p;
}
Expand All @@ -44,18 +44,18 @@ typedef union {
double d;
} TransparentUnion __attribute__((transparent_union));

// NULL-INVALID: define i32 @bar6(i64 %
// NULL-VALID: define i32 @bar6(i64 %
// NULL-INVALID: define{{.*}} i32 @bar6(i64 %
// NULL-VALID: define{{.*}} i32 @bar6(i64 %
int bar6(TransparentUnion tu) __attribute__((nonnull(1))) {
return *tu.p;
}

// NULL-INVALID: define void @bar7(i32* nonnull %a, i32* nonnull %b)
// NULL-VALID: define void @bar7(i32* %a, i32* %b)
// NULL-INVALID: define{{.*}} void @bar7(i32* nonnull %a, i32* nonnull %b)
// NULL-VALID: define{{.*}} void @bar7(i32* %a, i32* %b)
void bar7(int *a, int *b) __attribute__((nonnull(1)))
__attribute__((nonnull(2))) {}

// NULL-INVALID: define void @bar8(i32* nonnull %a, i32* nonnull %b)
// NULL-VALID: define void @bar8(i32* %a, i32* %b)
// NULL-INVALID: define{{.*}} void @bar8(i32* nonnull %a, i32* nonnull %b)
// NULL-VALID: define{{.*}} void @bar8(i32* %a, i32* %b)
void bar8(int *a, int *b) __attribute__((nonnull))
__attribute__((nonnull(1))) {}
32 changes: 16 additions & 16 deletions clang/test/CodeGen/object-size.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,46 +20,46 @@ char gbuf[63];
char *gp;
int gi, gj;

// CHECK-LABEL: define void @test1
// CHECK-LABEL: define{{.*}} void @test1
void test1() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 4), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 59)
strcpy(&gbuf[4], "Hi there");
}

// CHECK-LABEL: define void @test2
// CHECK-LABEL: define{{.*}} void @test2
void test2() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 63)
strcpy(gbuf, "Hi there");
}

// CHECK-LABEL: define void @test3
// CHECK-LABEL: define{{.*}} void @test3
void test3() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 1, i64 37), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 0)
strcpy(&gbuf[100], "Hi there");
}

// CHECK-LABEL: define void @test4
// CHECK-LABEL: define{{.*}} void @test4
void test4() {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 -1), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 0)
strcpy((char*)(void*)&gbuf[-1], "Hi there");
}

// CHECK-LABEL: define void @test5
// CHECK-LABEL: define{{.*}} void @test5
void test5() {
// CHECK: = load i8*, i8** @gp
// CHECK-NEXT:= call i64 @llvm.objectsize.i64.p0i8(i8* %{{.*}}, i1 false, i1 true, i1
strcpy(gp, "Hi there");
}

// CHECK-LABEL: define void @test6
// CHECK-LABEL: define{{.*}} void @test6
void test6() {
char buf[57];

// CHECK: = call i8* @__strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 53)
strcpy(&buf[4], "Hi there");
}

// CHECK-LABEL: define void @test7
// CHECK-LABEL: define{{.*}} void @test7
void test7() {
int i;
// Ensure we only evaluate the side-effect once.
Expand All @@ -69,65 +69,65 @@ void test7() {
strcpy((++i, gbuf), "Hi there");
}

// CHECK-LABEL: define void @test8
// CHECK-LABEL: define{{.*}} void @test8
void test8() {
char *buf[50];
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(buf[++gi], "Hi there");
}

// CHECK-LABEL: define void @test9
// CHECK-LABEL: define{{.*}} void @test9
void test9() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy((char *)((++gi) + gj), "Hi there");
}

// CHECK-LABEL: define void @test10
// CHECK-LABEL: define{{.*}} void @test10
char **p;
void test10() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(*(++p), "Hi there");
}

// CHECK-LABEL: define void @test11
// CHECK-LABEL: define{{.*}} void @test11
void test11() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(gp = gbuf, "Hi there");
}

// CHECK-LABEL: define void @test12
// CHECK-LABEL: define{{.*}} void @test12
void test12() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(++gp, "Hi there");
}

// CHECK-LABEL: define void @test13
// CHECK-LABEL: define{{.*}} void @test13
void test13() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(gp++, "Hi there");
}

// CHECK-LABEL: define void @test14
// CHECK-LABEL: define{{.*}} void @test14
void test14() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(--gp, "Hi there");
}

// CHECK-LABEL: define void @test15
// CHECK-LABEL: define{{.*}} void @test15
void test15() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{..*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(gp--, "Hi there");
}

// CHECK-LABEL: define void @test16
// CHECK-LABEL: define{{.*}} void @test16
void test16() {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/object-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

int gi;

// CHECK-LABEL: define void @_Z5test1v()
// CHECK-LABEL: define{{.*}} void @_Z5test1v()
void test1() {
// Guaranteeing that our cast removal logic doesn't break more interesting
// cases.
Expand All @@ -29,7 +29,7 @@ void test1() {
gi = __builtin_object_size((char*)(B*)&c, 0);
}

// CHECK-LABEL: define void @_Z5test2v()
// CHECK-LABEL: define{{.*}} void @_Z5test2v()
void test2() {
struct A { char buf[16]; };
struct B : A {};
Expand Down
72 changes: 36 additions & 36 deletions clang/test/CodeGen/pass-object-size.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,57 +11,57 @@ struct Foo {

int gi = 0;

// CHECK-LABEL: define i32 @ObjectSize0(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @ObjectSize0(i8* %{{.*}}, i64 %0)
int ObjectSize0(void *const p PS(0)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 0);
}

// CHECK-LABEL: define i32 @DynamicObjectSize0(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @DynamicObjectSize0(i8* %{{.*}}, i64 %0)
int DynamicObjectSize0(void *const p PDS(0)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_dynamic_object_size(p, 0);
}

// CHECK-LABEL: define i32 @ObjectSize1(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @ObjectSize1(i8* %{{.*}}, i64 %0)
int ObjectSize1(void *const p PS(1)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 1);
}

// CHECK-LABEL: define i32 @DynamicObjectSize1(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @DynamicObjectSize1(i8* %{{.*}}, i64 %0)
int DynamicObjectSize1(void *const p PDS(1)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_dynamic_object_size(p, 1);
}

// CHECK-LABEL: define i32 @ObjectSize2(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @ObjectSize2(i8* %{{.*}}, i64 %0)
int ObjectSize2(void *const p PS(2)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 2);
}

// CHECK-LABEL: define i32 @DynamicObjectSize2(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @DynamicObjectSize2(i8* %{{.*}}, i64 %0)
int DynamicObjectSize2(void *const p PDS(2)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 2);
}

// CHECK-LABEL: define i32 @ObjectSize3(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @ObjectSize3(i8* %{{.*}}, i64 %0)
int ObjectSize3(void *const p PS(3)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 3);
}

// CHECK-LABEL: define i32 @DynamicObjectSize3(i8* %{{.*}}, i64 %0)
// CHECK-LABEL: define{{.*}} i32 @DynamicObjectSize3(i8* %{{.*}}, i64 %0)
int DynamicObjectSize3(void *const p PDS(3)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 3);
}

void *malloc(unsigned long) __attribute__((alloc_size(1)));

// CHECK-LABEL: define void @test1
// CHECK-LABEL: define{{.*}} void @test1
void test1(unsigned long sz) {
struct Foo t[10];

Expand Down Expand Up @@ -99,7 +99,7 @@ void test1(unsigned long sz) {
gi = DynamicObjectSize2(ptr);
}

// CHECK-LABEL: define void @test2
// CHECK-LABEL: define{{.*}} void @test2
void test2(struct Foo *t) {
// CHECK: [[VAR:%[0-9]+]] = call i64 @llvm.objectsize
// CHECK: call i32 @ObjectSize1(i8* %{{.*}}, i64 [[VAR]])
Expand All @@ -108,38 +108,38 @@ void test2(struct Foo *t) {
gi = ObjectSize3(&t->t[1]);
}

// CHECK-LABEL: define i32 @_Z27NoViableOverloadObjectSize0Pv
// CHECK-LABEL: define{{.*}} i32 @_Z27NoViableOverloadObjectSize0Pv
int NoViableOverloadObjectSize0(void *const p) __attribute__((overloadable)) {
// CHECK: @llvm.objectsize
return __builtin_object_size(p, 0);
}

// CHECK-LABEL: define i32 @_Z34NoViableOverloadDynamicObjectSize0Pv
// CHECK-LABEL: define{{.*}} i32 @_Z34NoViableOverloadDynamicObjectSize0Pv
int NoViableOverloadDynamicObjectSize0(void *const p)
__attribute__((overloadable)) {
// CHECK: @llvm.objectsize
return __builtin_object_size(p, 0);
}

// CHECK-LABEL: define i32 @_Z27NoViableOverloadObjectSize1Pv
// CHECK-LABEL: define{{.*}} i32 @_Z27NoViableOverloadObjectSize1Pv
int NoViableOverloadObjectSize1(void *const p) __attribute__((overloadable)) {
// CHECK: @llvm.objectsize
return __builtin_object_size(p, 1);
}

// CHECK-LABEL: define i32 @_Z27NoViableOverloadObjectSize2Pv
// CHECK-LABEL: define{{.*}} i32 @_Z27NoViableOverloadObjectSize2Pv
int NoViableOverloadObjectSize2(void *const p) __attribute__((overloadable)) {
// CHECK: @llvm.objectsize
return __builtin_object_size(p, 2);
}

// CHECK-LABEL: define i32 @_Z27NoViableOverloadObjectSize3Pv
// CHECK-LABEL: define{{.*}} i32 @_Z27NoViableOverloadObjectSize3Pv
int NoViableOverloadObjectSize3(void *const p) __attribute__((overloadable)) {
// CHECK-NOT: @llvm.objectsize
return __builtin_object_size(p, 3);
}

// CHECK-LABEL: define i32 @_Z27NoViableOverloadObjectSize0Pv
// CHECK-LABEL: define{{.*}} i32 @_Z27NoViableOverloadObjectSize0Pv
// CHECK-NOT: @llvm.objectsize
int NoViableOverloadObjectSize0(void *const p PS(0))
__attribute__((overloadable)) {
Expand Down Expand Up @@ -187,7 +187,7 @@ int NoViableOverloadObjectSize3(void *const p PS(3))
return SHOULDNT_BE_CALLED;
}

// CHECK-LABEL: define void @test3
// CHECK-LABEL: define{{.*}} void @test3
void test3() {
struct Foo t[10];

Expand All @@ -213,7 +213,7 @@ void test3() {
gi = NoViableOverloadDynamicObjectSize0(&t[1]);
}

// CHECK-LABEL: define void @test4
// CHECK-LABEL: define{{.*}} void @test4
void test4(struct Foo *t) {
// CHECK: call i32 @_Z27NoViableOverloadObjectSize0PvU17pass_object_size0(i8* %{{.*}}, i64 %{{.*}})
gi = NoViableOverloadObjectSize0(&t[1]);
Expand Down Expand Up @@ -245,28 +245,28 @@ void test5() {
gi = g(&t[1]);
}

// CHECK-LABEL: define i32 @IndirectObjectSize0
// CHECK-LABEL: define{{.*}} i32 @IndirectObjectSize0
int IndirectObjectSize0(void *const p PS(0)) {
// CHECK: call i32 @ObjectSize0(i8* %{{.*}}, i64 %{{.*}})
// CHECK-NOT: @llvm.objectsize
return ObjectSize0(p);
}

// CHECK-LABEL: define i32 @IndirectObjectSize1
// CHECK-LABEL: define{{.*}} i32 @IndirectObjectSize1
int IndirectObjectSize1(void *const p PS(1)) {
// CHECK: call i32 @ObjectSize1(i8* %{{.*}}, i64 %{{.*}})
// CHECK-NOT: @llvm.objectsize
return ObjectSize1(p);
}

// CHECK-LABEL: define i32 @IndirectObjectSize2
// CHECK-LABEL: define{{.*}} i32 @IndirectObjectSize2
int IndirectObjectSize2(void *const p PS(2)) {
// CHECK: call i32 @ObjectSize2(i8* %{{.*}}, i64 %{{.*}})
// CHECK-NOT: @llvm.objectsize
return ObjectSize2(p);
}

// CHECK-LABEL: define i32 @IndirectObjectSize3
// CHECK-LABEL: define{{.*}} i32 @IndirectObjectSize3
int IndirectObjectSize3(void *const p PS(3)) {
// CHECK: call i32 @ObjectSize3(i8* %{{.*}}, i64 %{{.*}})
// CHECK-NOT: @llvm.objectsize
Expand All @@ -289,7 +289,7 @@ int OverloadedObjectSize(void *const p PS(0),
int OverloadedObjectSize(void *const p, void *const c)
__attribute__((overloadable)) __asm__("OverloadNoSize");

// CHECK-LABEL: define void @test6
// CHECK-LABEL: define{{.*}} void @test6
void test6() {
int known[10], *opaque;

Expand All @@ -308,7 +308,7 @@ void test6() {

int Identity(void *p, size_t i) { return i; }

// CHECK-NOT: define void @AsmObjectSize
// CHECK-NOT: define{{.*}} void @AsmObjectSize
int AsmObjectSize0(void *const p PS(0)) __asm__("Identity");

int AsmObjectSize1(void *const p PS(1)) __asm__("Identity");
Expand All @@ -317,7 +317,7 @@ int AsmObjectSize2(void *const p PS(2)) __asm__("Identity");

int AsmObjectSize3(void *const p PS(3)) __asm__("Identity");

// CHECK-LABEL: define void @test7
// CHECK-LABEL: define{{.*}} void @test7
void test7() {
struct Foo t[10];

Expand All @@ -340,7 +340,7 @@ void test7() {
gi = AsmObjectSize3(&t[1].t[1]);
}

// CHECK-LABEL: define void @test8
// CHECK-LABEL: define{{.*}} void @test8
void test8(struct Foo *t) {
// CHECK: [[VAR:%[0-9]+]] = call i64 @llvm.objectsize
// CHECK: call i32 @"\01Identity"(i8* %{{.*}}, i64 [[VAR]])
Expand All @@ -354,7 +354,7 @@ void DifferingObjectSize1(void *const p __attribute__((pass_object_size(1))));
void DifferingObjectSize2(void *const p __attribute__((pass_object_size(2))));
void DifferingObjectSize3(void *const p __attribute__((pass_object_size(3))));

// CHECK-LABEL: define void @test9
// CHECK-LABEL: define{{.*}} void @test9
void test9(void *const p __attribute__((pass_object_size(0)))) {
// CHECK: @llvm.objectsize
DifferingObjectSize2(p);
Expand All @@ -367,7 +367,7 @@ void test9(void *const p __attribute__((pass_object_size(0)))) {
DifferingObjectSize3(p);
}

// CHECK-LABEL: define void @test10
// CHECK-LABEL: define{{.*}} void @test10
void test10(void *const p __attribute__((pass_object_size(1)))) {
// CHECK: @llvm.objectsize
DifferingObjectSize2(p);
Expand All @@ -381,7 +381,7 @@ void test10(void *const p __attribute__((pass_object_size(1)))) {
DifferingObjectSize3(p);
}

// CHECK-LABEL: define void @test11
// CHECK-LABEL: define{{.*}} void @test11
void test11(void *const p __attribute__((pass_object_size(2)))) {
// CHECK: @llvm.objectsize
DifferingObjectSize0(p);
Expand All @@ -395,7 +395,7 @@ void test11(void *const p __attribute__((pass_object_size(2)))) {
DifferingObjectSize3(p);
}

// CHECK-LABEL: define void @test12
// CHECK-LABEL: define{{.*}} void @test12
void test12(void *const p __attribute__((pass_object_size(3)))) {
// CHECK: @llvm.objectsize
DifferingObjectSize0(p);
Expand All @@ -407,7 +407,7 @@ void test12(void *const p __attribute__((pass_object_size(3)))) {
DifferingObjectSize3(p);
}

// CHECK-LABEL: define void @test13
// CHECK-LABEL: define{{.*}} void @test13
void test13() {
char c[10];
unsigned i = 0;
Expand Down Expand Up @@ -435,7 +435,7 @@ void test13() {
// problems in the form of failed assertions.
void my_sprintf(char *const c __attribute__((pass_object_size(0))), ...) {}

// CHECK-LABEL: define void @test14
// CHECK-LABEL: define{{.*}} void @test14
void test14(char *c) {
// CHECK: @llvm.objectsize
// CHECK: call void (i8*, i64, ...) @my_sprintf
Expand All @@ -450,7 +450,7 @@ void pass_size_unsigned(unsigned *const PS(0));

// Bug: we weren't lowering to the proper @llvm.objectsize for pointers that
// don't turn into i8*s, which caused crashes.
// CHECK-LABEL: define void @test15
// CHECK-LABEL: define{{.*}} void @test15
void test15(unsigned *I) {
// CHECK: @llvm.objectsize.i64.p0i32
// CHECK: call void @pass_size_unsigned
Expand All @@ -462,7 +462,7 @@ void pass_size_as1(__attribute__((address_space(1))) void *const PS(0));
void pass_size_unsigned_as1(
__attribute__((address_space(1))) unsigned *const PS(0));

// CHECK-LABEL: define void @test16
// CHECK-LABEL: define{{.*}} void @test16
void test16(__attribute__((address_space(1))) unsigned *I) {
// CHECK: call i64 @llvm.objectsize.i64.p1i8
// CHECK: call void @pass_size_as1
Expand All @@ -474,7 +474,7 @@ void test16(__attribute__((address_space(1))) unsigned *I) {

// This used to cause assertion failures, since we'd try to emit the statement
// expression (and definitions for `a`) twice.
// CHECK-LABEL: define void @test17
// CHECK-LABEL: define{{.*}} void @test17
void test17(char *C) {
// Check for 65535 to see if we're emitting this pointer twice.
// CHECK: 65535
Expand All @@ -485,7 +485,7 @@ void test17(char *C) {
ObjectSize0(C + ({ int a = 65535; a; }));
}

// CHECK-LABEL: define void @test18
// CHECK-LABEL: define{{.*}} void @test18
void test18(char *const p PDS(0)) {
// CHECK-NOT: llvm.objectsize
gi = __builtin_dynamic_object_size(p, 0);
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/pr12251.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enum e1 g1(enum e1 *x) {
return *x;
}

// CHECK-LABEL: define i32 @g1
// CHECK-LABEL: define{{.*}} i32 @g1
// CHECK: load i32, i32* %x, align 4
// CHECK-NOT: range
// CHECK: ret
4 changes: 2 additions & 2 deletions clang/test/CodeGen/pragma-pack-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ struct S4
// CHECK: %struct.S4 = type { [3 x i8], %struct.T4, i32 }
// CHECK: %struct.T4 = type <{ i8, i32 }>

// CHECK: @refs = global [[struct_ref]]
// CHECK: @ss = global [[struct_S]]
// CHECK: @refs ={{.*}} global [[struct_ref]]
// CHECK: @ss ={{.*}} global [[struct_S]]
4 changes: 2 additions & 2 deletions clang/test/CodeGen/pragma-visibility.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int y = 4;
#pragma GCC visibility push(hidden)
extern __attribute((visibility("default"))) int z;
int z = 0;
// CHECK: @z = global
// CHECK: @z ={{.*}} global
#pragma GCC visibility pop

#pragma GCC visibility push(hidden)
Expand All @@ -21,4 +21,4 @@ void f() {}

__attribute((visibility("default"))) void g();
void g() {}
// CHECK-LABEL: define void @g
// CHECK-LABEL: define{{.*}} void @g
2 changes: 1 addition & 1 deletion clang/test/CodeGen/private-extern-redef.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ void foo() {

// CHECK: @J = hidden constant
// CHECK: @K = hidden constant
// CHECK: @L = constant
// CHECK: @L ={{.*}} constant
// CHECK: @M = hidden global
// CHECK: @O = hidden global
// CHECK: @I = external hidden
Expand Down
10 changes: 5 additions & 5 deletions clang/test/CodeGen/restrict.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

// PR6695

// CHECK: define void @test0(i32* %{{.*}}, i32 %{{.*}})
// CHECK: define{{.*}} void @test0(i32* %{{.*}}, i32 %{{.*}})
void test0(int *x, int y) {
}

// CHECK: define void @test1(i32* noalias %{{.*}}, i32 %{{.*}})
// CHECK: define{{.*}} void @test1(i32* noalias %{{.*}}, i32 %{{.*}})
void test1(int * restrict x, int y) {
}

// CHECK: define void @test2(i32* %{{.*}}, i32* noalias %{{.*}})
// CHECK: define{{.*}} void @test2(i32* %{{.*}}, i32* noalias %{{.*}})
void test2(int *x, int * restrict y) {
}

typedef int * restrict rp;

// CHECK: define void @test3(i32* noalias %{{.*}}, i32 %{{.*}})
// CHECK: define{{.*}} void @test3(i32* noalias %{{.*}}, i32 %{{.*}})
void test3(rp x, int y) {
}

// CHECK: define void @test4(i32* %{{.*}}, i32* noalias %{{.*}})
// CHECK: define{{.*}} void @test4(i32* %{{.*}}, i32* noalias %{{.*}})
void test4(int *x, rp y) {
}

4 changes: 2 additions & 2 deletions clang/test/CodeGen/sanitize-atomic-int-overflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

_Atomic(unsigned) atomic;

// CHECK-LABEL: define void @cmpd_assign
// CHECK-LABEL: define{{.*}} void @cmpd_assign
void cmpd_assign() {
// CHECK: br label %[[LOOP_START:.*]]

Expand All @@ -17,7 +17,7 @@ void cmpd_assign() {
atomic += 1;
}

// CHECK-LABEL: define void @inc
// CHECK-LABEL: define{{.*}} void @inc
void inc() {
// CHECK: br label %[[LOOP_START:.*]]

Expand Down
48 changes: 24 additions & 24 deletions clang/test/CodeGen/tbaa-class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ class StructS2 : public StructS
};

uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
// CHECK-LABEL: define i32 @_Z1g
// CHECK-LABEL: define{{.*}} i32 @_Z1g
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z1g
// PATH-LABEL: define{{.*}} i32 @_Z1g
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32:!.*]]
*s = 1;
Expand All @@ -64,10 +64,10 @@ uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
}

uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g2
// CHECK-LABEL: define{{.*}} i32 @_Z2g2
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_i16:!.*]]
// PATH-LABEL: define i32 @_Z2g2
// PATH-LABEL: define{{.*}} i32 @_Z2g2
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_A_f16:!.*]]
*s = 1;
Expand All @@ -76,10 +76,10 @@ uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
}

uint32_t g3(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g3
// CHECK-LABEL: define{{.*}} i32 @_Z2g3
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g3
// PATH-LABEL: define{{.*}} i32 @_Z2g3
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32:!.*]]
A->f32 = 1;
Expand All @@ -88,10 +88,10 @@ uint32_t g3(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g4(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g4
// CHECK-LABEL: define{{.*}} i32 @_Z2g4
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_i16]]
// PATH-LABEL: define i32 @_Z2g4
// PATH-LABEL: define{{.*}} i32 @_Z2g4
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_B_a_f16:!.*]]
A->f32 = 1;
Expand All @@ -100,10 +100,10 @@ uint32_t g4(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g5(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g5
// CHECK-LABEL: define{{.*}} i32 @_Z2g5
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g5
// PATH-LABEL: define{{.*}} i32 @_Z2g5
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_f32:!.*]]
A->f32 = 1;
Expand All @@ -112,10 +112,10 @@ uint32_t g5(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g6(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g6
// CHECK-LABEL: define{{.*}} i32 @_Z2g6
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g6
// PATH-LABEL: define{{.*}} i32 @_Z2g6
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32_2:!.*]]
A->f32 = 1;
Expand All @@ -124,10 +124,10 @@ uint32_t g6(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g7(StructA *A, StructS *S, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g7
// CHECK-LABEL: define{{.*}} i32 @_Z2g7
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g7
// PATH-LABEL: define{{.*}} i32 @_Z2g7
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32:!.*]]
A->f32 = 1;
Expand All @@ -136,10 +136,10 @@ uint32_t g7(StructA *A, StructS *S, uint64_t count) {
}

uint32_t g8(StructA *A, StructS *S, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g8
// CHECK-LABEL: define{{.*}} i32 @_Z2g8
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_i16]]
// PATH-LABEL: define i32 @_Z2g8
// PATH-LABEL: define{{.*}} i32 @_Z2g8
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_S_f16:!.*]]
A->f32 = 1;
Expand All @@ -148,10 +148,10 @@ uint32_t g8(StructA *A, StructS *S, uint64_t count) {
}

uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g9
// CHECK-LABEL: define{{.*}} i32 @_Z2g9
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g9
// PATH-LABEL: define{{.*}} i32 @_Z2g9
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32:!.*]]
S->f32 = 1;
Expand All @@ -160,10 +160,10 @@ uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
}

uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK-LABEL: define i32 @_Z3g10
// CHECK-LABEL: define{{.*}} i32 @_Z3g10
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z3g10
// PATH-LABEL: define{{.*}} i32 @_Z3g10
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S2_f32_2:!.*]]
S->f32 = 1;
Expand All @@ -172,10 +172,10 @@ uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
}

uint32_t g11(StructC *C, StructD *D, uint64_t count) {
// CHECK-LABEL: define i32 @_Z3g11
// CHECK-LABEL: define{{.*}} i32 @_Z3g11
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z3g11
// PATH-LABEL: define{{.*}} i32 @_Z3g11
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_C_b_a_f32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_D_b_a_f32:!.*]]
C->b.a.f32 = 1;
Expand All @@ -184,11 +184,11 @@ uint32_t g11(StructC *C, StructD *D, uint64_t count) {
}

uint32_t g12(StructC *C, StructD *D, uint64_t count) {
// CHECK-LABEL: define i32 @_Z3g12
// CHECK-LABEL: define{{.*}} i32 @_Z3g12
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// TODO: differentiate the two accesses.
// PATH-LABEL: define i32 @_Z3g12
// PATH-LABEL: define{{.*}} i32 @_Z3g12
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32]]
StructB *b1 = &(C->b);
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/tbaa-vec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ struct A {
};

void foo(A *a, __m128 v) {
// CHECK-LABEL: define void @_Z3fooP1ADv4_f
// CHECK-LABEL: define{{.*}} void @_Z3fooP1ADv4_f
a->a = v;
// CHECK: store <4 x float> %v, <4 x float>* %{{.*}}, align 16, !tbaa [[TAG_char:!.*]]
// CHECK: store <4 x float> %{{.*}}, <4 x float>* %{{.*}}, align 16, !tbaa [[TAG_char]]
Expand Down
60 changes: 30 additions & 30 deletions clang/test/CodeGen/tbaa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ typedef struct
} StructS2;

uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
// CHECK-LABEL: define i32 @_Z1g
// CHECK-LABEL: define{{.*}} i32 @_Z1g
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z1g
// PATH-LABEL: define{{.*}} i32 @_Z1g
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32:!.*]]
*s = 1;
Expand All @@ -62,10 +62,10 @@ uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
}

uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g2
// CHECK-LABEL: define{{.*}} i32 @_Z2g2
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_i16:!.*]]
// PATH-LABEL: define i32 @_Z2g2
// PATH-LABEL: define{{.*}} i32 @_Z2g2
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_A_f16:!.*]]
*s = 1;
Expand All @@ -74,10 +74,10 @@ uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
}

uint32_t g3(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g3
// CHECK-LABEL: define{{.*}} i32 @_Z2g3
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g3
// PATH-LABEL: define{{.*}} i32 @_Z2g3
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32:!.*]]
A->f32 = 1;
Expand All @@ -86,10 +86,10 @@ uint32_t g3(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g4(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g4
// CHECK-LABEL: define{{.*}} i32 @_Z2g4
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_i16]]
// PATH-LABEL: define i32 @_Z2g4
// PATH-LABEL: define{{.*}} i32 @_Z2g4
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_B_a_f16:!.*]]
A->f32 = 1;
Expand All @@ -98,10 +98,10 @@ uint32_t g4(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g5(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g5
// CHECK-LABEL: define{{.*}} i32 @_Z2g5
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g5
// PATH-LABEL: define{{.*}} i32 @_Z2g5
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_f32:!.*]]
A->f32 = 1;
Expand All @@ -110,10 +110,10 @@ uint32_t g5(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g6(StructA *A, StructB *B, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g6
// CHECK-LABEL: define{{.*}} i32 @_Z2g6
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g6
// PATH-LABEL: define{{.*}} i32 @_Z2g6
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32_2:!.*]]
A->f32 = 1;
Expand All @@ -122,10 +122,10 @@ uint32_t g6(StructA *A, StructB *B, uint64_t count) {
}

uint32_t g7(StructA *A, StructS *S, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g7
// CHECK-LABEL: define{{.*}} i32 @_Z2g7
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g7
// PATH-LABEL: define{{.*}} i32 @_Z2g7
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32:!.*]]
A->f32 = 1;
Expand All @@ -134,10 +134,10 @@ uint32_t g7(StructA *A, StructS *S, uint64_t count) {
}

uint32_t g8(StructA *A, StructS *S, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g8
// CHECK-LABEL: define{{.*}} i32 @_Z2g8
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_i16]]
// PATH-LABEL: define i32 @_Z2g8
// PATH-LABEL: define{{.*}} i32 @_Z2g8
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_A_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_S_f16:!.*]]
A->f32 = 1;
Expand All @@ -146,10 +146,10 @@ uint32_t g8(StructA *A, StructS *S, uint64_t count) {
}

uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK-LABEL: define i32 @_Z2g9
// CHECK-LABEL: define{{.*}} i32 @_Z2g9
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z2g9
// PATH-LABEL: define{{.*}} i32 @_Z2g9
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S2_f32:!.*]]
S->f32 = 1;
Expand All @@ -158,10 +158,10 @@ uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
}

uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
// CHECK-LABEL: define i32 @_Z3g10
// CHECK-LABEL: define{{.*}} i32 @_Z3g10
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_i16]]
// PATH-LABEL: define i32 @_Z3g10
// PATH-LABEL: define{{.*}} i32 @_Z3g10
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i16 4, i16* %{{.*}}, align 4, !tbaa [[TAG_S2_f16:!.*]]
S->f32 = 1;
Expand All @@ -170,10 +170,10 @@ uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
}

uint32_t g11(StructC *C, StructD *D, uint64_t count) {
// CHECK-LABEL: define i32 @_Z3g11
// CHECK-LABEL: define{{.*}} i32 @_Z3g11
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z3g11
// PATH-LABEL: define{{.*}} i32 @_Z3g11
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_C_b_a_f32:!.*]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_D_b_a_f32:!.*]]
C->b.a.f32 = 1;
Expand All @@ -182,11 +182,11 @@ uint32_t g11(StructC *C, StructD *D, uint64_t count) {
}

uint32_t g12(StructC *C, StructD *D, uint64_t count) {
// CHECK-LABEL: define i32 @_Z3g12
// CHECK-LABEL: define{{.*}} i32 @_Z3g12
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// TODO: differentiate the two accesses.
// PATH-LABEL: define i32 @_Z3g12
// PATH-LABEL: define{{.*}} i32 @_Z3g12
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_B_a_f32]]
StructB *b1 = &(C->b);
Expand All @@ -207,9 +207,9 @@ struct five {
} ATTR;
char g13(struct five *a, struct five *b) {
return a->b;
// CHECK-LABEL: define signext i8 @_Z3g13
// CHECK-LABEL: define{{.*}} signext i8 @_Z3g13
// CHECK: load i8, i8* %{{.*}}, align 1, !tbaa [[TAG_char:!.*]]
// PATH-LABEL: define signext i8 @_Z3g13
// PATH-LABEL: define{{.*}} signext i8 @_Z3g13
// PATH: load i8, i8* %{{.*}}, align 1, !tbaa [[TAG_five_b:!.*]]
}

Expand All @@ -220,20 +220,20 @@ struct six {
char c;
};
char g14(struct six *a, struct six *b) {
// CHECK-LABEL: define signext i8 @_Z3g14
// CHECK-LABEL: define{{.*}} signext i8 @_Z3g14
// CHECK: load i8, i8* %{{.*}}, align 1, !tbaa [[TAG_char]]
// PATH-LABEL: define signext i8 @_Z3g14
// PATH-LABEL: define{{.*}} signext i8 @_Z3g14
// PATH: load i8, i8* %{{.*}}, align 1, !tbaa [[TAG_six_b:!.*]]
return a->b;
}

// Types that differ only by name may alias.
typedef StructS StructS3;
uint32_t g15(StructS *S, StructS3 *S3, uint64_t count) {
// CHECK-LABEL: define i32 @_Z3g15
// CHECK-LABEL: define{{.*}} i32 @_Z3g15
// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_i32]]
// PATH-LABEL: define i32 @_Z3g15
// PATH-LABEL: define{{.*}} i32 @_Z3g15
// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa [[TAG_S_f32]]
S->f32 = 1;
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGen/trapv.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
unsigned int ui, uj, uk;
int i, j, k;

// CHECK-LABEL: define void @test0()
// CHECK-LABEL: define{{.*}} void @test0()
void test0() {
// -ftrapv doesn't affect unsigned arithmetic.
// CHECK: [[T1:%.*]] = load i32, i32* @uj
Expand All @@ -23,7 +23,7 @@ void test0() {
i = j + k;
}

// CHECK-LABEL: define void @test1()
// CHECK-LABEL: define{{.*}} void @test1()
void test1() {
extern void opaque(int);
opaque(i++);
Expand All @@ -37,7 +37,7 @@ void test1() {
// CHECK: call void @llvm.ubsantrap(i8 0)
}

// CHECK-LABEL: define void @test2()
// CHECK-LABEL: define{{.*}} void @test2()
void test2() {
extern void opaque(int);
opaque(++i);
Expand All @@ -51,7 +51,7 @@ void test2() {
// CHECK: call void @llvm.ubsantrap(i8 0)
}

// CHECK-LABEL: define void @test3(
// CHECK-LABEL: define{{.*}} void @test3(
void test3(int a, int b, float c, float d) {
// CHECK-NOT: @llvm.trap
(void)(a / b);
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/ubsan-builtin-checks.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

// NOT-UB-NOT: __ubsan_handle_invalid_builtin

// CHECK: define void @check_ctz
// CHECK: define{{.*}} void @check_ctz
void check_ctz(int n) {
// CHECK: [[NOT_ZERO:%.*]] = icmp ne i32 [[N:%.*]], 0, !nosanitize
// CHECK-NEXT: br i1 [[NOT_ZERO]]
Expand All @@ -23,7 +23,7 @@ void check_ctz(int n) {
__builtin_ctzll(n);
}

// CHECK: define void @check_clz
// CHECK: define{{.*}} void @check_clz
void check_clz(int n) {
// CHECK: [[NOT_ZERO:%.*]] = icmp ne i32 [[N:%.*]], 0, !nosanitize
// CHECK-NEXT: br i1 [[NOT_ZERO]]
Expand Down
14 changes: 7 additions & 7 deletions clang/test/CodeGen/ubsan-pass-object-size.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 %s -emit-llvm -w -triple x86_64-apple-darwin10 -fsanitize=array-bounds -o - | FileCheck %s

// CHECK-LABEL: define i32 @foo(
// CHECK-LABEL: define{{.*}} i32 @foo(
int foo(int *const p __attribute__((pass_object_size(0))), int n) {
int x = (p)[n];

Expand All @@ -25,42 +25,42 @@ int foo(int *const p __attribute__((pass_object_size(0))), int n) {

typedef struct {} ZeroSizedType;

// CHECK-LABEL: define void @bar(
// CHECK-LABEL: define{{.*}} void @bar(
ZeroSizedType bar(ZeroSizedType *const p __attribute__((pass_object_size(0))), int n) {
// CHECK-NOT: __ubsan_handle_out_of_bounds
// CHECK: ret void
return p[n];
}

// CHECK-LABEL: define i32 @baz(
// CHECK-LABEL: define{{.*}} i32 @baz(
int baz(int *const p __attribute__((pass_object_size(1))), int n) {
// CHECK: __ubsan_handle_out_of_bounds
// CHECK: ret i32
return p[n];
}

// CHECK-LABEL: define i32 @mat(
// CHECK-LABEL: define{{.*}} i32 @mat(
int mat(int *const p __attribute__((pass_object_size(2))), int n) {
// CHECK-NOT: __ubsan_handle_out_of_bounds
// CHECK: ret i32
return p[n];
}

// CHECK-LABEL: define i32 @pat(
// CHECK-LABEL: define{{.*}} i32 @pat(
int pat(int *const p __attribute__((pass_object_size(3))), int n) {
// CHECK-NOT: __ubsan_handle_out_of_bounds
// CHECK: ret i32
return p[n];
}

// CHECK-LABEL: define i32 @cat(
// CHECK-LABEL: define{{.*}} i32 @cat(
int cat(int p[static 10], int n) {
// CHECK-NOT: __ubsan_handle_out_of_bounds
// CHECK: ret i32
return p[n];
}

// CHECK-LABEL: define i32 @bat(
// CHECK-LABEL: define{{.*}} i32 @bat(
int bat(int n, int p[n]) {
// CHECK-NOT: __ubsan_handle_out_of_bounds
// CHECK: ret i32
Expand Down
16 changes: 8 additions & 8 deletions clang/test/CodeGen/ubsan-pointer-overflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
extern "C" {
#endif

// CHECK-LABEL: define void @fixed_len_array
// CHECK-LABEL: define{{.*}} void @fixed_len_array
void fixed_len_array(int k) {
// CHECK: getelementptr inbounds [10 x [10 x i32]], [10 x [10 x i32]]* [[ARR:%.*]], i64 0, i64 [[IDXPROM:%.*]]
// CHECK-NEXT: [[SMUL:%.*]] = call { i64, i1 } @llvm.smul.with.overflow.i64(i64 40, i64 [[IDXPROM]]), !nosanitize
Expand All @@ -23,7 +23,7 @@ void fixed_len_array(int k) {
arr[k][k];
}

// CHECK-LABEL: define void @variable_len_array
// CHECK-LABEL: define{{.*}} void @variable_len_array
void variable_len_array(int n, int k) {
// CHECK: getelementptr inbounds i32, i32* {{.*}}, i64 [[IDXPROM:%.*]]
// CHECK-NEXT: @llvm.smul.with.overflow.i64(i64 4, i64 [[IDXPROM]]), !nosanitize
Expand All @@ -37,7 +37,7 @@ void variable_len_array(int n, int k) {
arr[k][k];
}

// CHECK-LABEL: define void @pointer_array
// CHECK-LABEL: define{{.*}} void @pointer_array
void pointer_array(int **arr, int k) {
// CHECK: @llvm.smul.with.overflow.i64(i64 8, i64 {{.*}}), !nosanitize
// CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
Expand All @@ -48,7 +48,7 @@ void pointer_array(int **arr, int k) {
arr[k][k];
}

// CHECK-LABEL: define void @pointer_array_unsigned_indices
// CHECK-LABEL: define{{.*}} void @pointer_array_unsigned_indices
void pointer_array_unsigned_indices(int **arr, unsigned k) {
// CHECK: icmp uge
// CHECK-NOT: select
Expand All @@ -59,7 +59,7 @@ void pointer_array_unsigned_indices(int **arr, unsigned k) {
arr[k][k];
}

// CHECK-LABEL: define void @pointer_array_mixed_indices
// CHECK-LABEL: define{{.*}} void @pointer_array_mixed_indices
void pointer_array_mixed_indices(int **arr, int i, unsigned j) {
// CHECK: select
// CHECK: call void @__ubsan_handle_pointer_overflow{{.*}}
Expand All @@ -80,7 +80,7 @@ struct S1 {
// TODO: Currently, structure GEPs are not checked, so there are several
// potentially unsafe GEPs here which we don't instrument.
//
// CHECK-LABEL: define void @struct_index
// CHECK-LABEL: define{{.*}} void @struct_index
void struct_index(struct S1 *p) {
// CHECK: getelementptr inbounds %struct.S1, %struct.S1* [[P:%.*]], i64 10
// CHECK-NEXT: [[BASE:%.*]] = ptrtoint %struct.S1* [[P]] to i64, !nosanitize
Expand All @@ -95,7 +95,7 @@ void struct_index(struct S1 *p) {

typedef void (*funcptr_t)(void);

// CHECK-LABEL: define void @function_pointer_arith
// CHECK-LABEL: define{{.*}} void @function_pointer_arith
void function_pointer_arith(funcptr_t *p, int k) {
// CHECK: add i64 {{.*}}, 8, !nosanitize
// CHECK-NOT: select
Expand All @@ -108,7 +108,7 @@ void function_pointer_arith(funcptr_t *p, int k) {
p + k;
}

// CHECK-LABEL: define void @dont_emit_checks_for_no_op_GEPs
// CHECK-LABEL: define{{.*}} void @dont_emit_checks_for_no_op_GEPs
// CHECK-C: __ubsan_handle_pointer_overflow
// CHECK-CPP-NOT: __ubsan_handle_pointer_overflow
void dont_emit_checks_for_no_op_GEPs(char *p) {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/ubsan-pointer-overflow.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -w -emit-llvm -o - %s -fsanitize=pointer-overflow | FileCheck %s

// CHECK-LABEL: define void @variable_len_array_arith
// CHECK-LABEL: define{{.*}} void @variable_len_array_arith
void variable_len_array_arith(int n, int k) {
int vla[n];
int (*p)[n] = &vla;
Expand All @@ -18,7 +18,7 @@ void variable_len_array_arith(int n, int k) {
p + k;
}
// CHECK-LABEL: define void @objc_id
// CHECK-LABEL: define{{.*}} void @objc_id
void objc_id(id *p) {
// CHECK: add i64 {{.*}}, 8, !nosanitize
// CHECK-NOT: select
Expand Down
56 changes: 28 additions & 28 deletions clang/test/CodeGen/ubsan-promoted-arith.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,120 +12,120 @@ enum E2 : char {
b
};

// CHECK-LABEL: define signext i8 @_Z4add1
// CHECK-LABEL: define{{.*}} signext i8 @_Z4add1
// CHECK-NOT: sadd.with.overflow
char add1(char c) { return c + c; }

// CHECK-LABEL: define zeroext i8 @_Z4add2
// CHECK-LABEL: define{{.*}} zeroext i8 @_Z4add2
// CHECK-NOT: uadd.with.overflow
uchar add2(uchar uc) { return uc + uc; }

// CHECK-LABEL: define i32 @_Z4add3
// CHECK-LABEL: define{{.*}} i32 @_Z4add3
// CHECK: sadd.with.overflow
int add3(E1 e) { return e + a; }

// CHECK-LABEL: define signext i8 @_Z4add4
// CHECK-LABEL: define{{.*}} signext i8 @_Z4add4
// CHECK-NOT: sadd.with.overflow
char add4(E2 e) { return e + b; }

// CHECK-LABEL: define signext i8 @_Z4sub1
// CHECK-LABEL: define{{.*}} signext i8 @_Z4sub1
// CHECK-NOT: ssub.with.overflow
char sub1(char c) { return c - c; }

// CHECK-LABEL: define zeroext i8 @_Z4sub2
// CHECK-LABEL: define{{.*}} zeroext i8 @_Z4sub2
// CHECK-NOT: usub.with.overflow
uchar sub2(uchar uc) { return uc - uc; }

// CHECK-LABEL: define signext i8 @_Z4sub3
// CHECK-LABEL: define{{.*}} signext i8 @_Z4sub3
// CHECK-NOT: ssub.with.overflow
char sub3(char c) { return -c; }

// Note: -INT_MIN can overflow.
//
// CHECK-LABEL: define i32 @_Z4sub4
// CHECK-LABEL: define{{.*}} i32 @_Z4sub4
// CHECK: ssub.with.overflow
int sub4(int i) { return -i; }

// CHECK-LABEL: define signext i8 @_Z4mul1
// CHECK-LABEL: define{{.*}} signext i8 @_Z4mul1
// CHECK-NOT: smul.with.overflow
char mul1(char c) { return c * c; }

// CHECK-LABEL: define zeroext i8 @_Z4mul2
// CHECK-LABEL: define{{.*}} zeroext i8 @_Z4mul2
// CHECK-NOT: smul.with.overflow
uchar mul2(uchar uc) { return uc * uc; }

// Note: USHRT_MAX * USHRT_MAX can overflow.
//
// CHECK-LABEL: define zeroext i16 @_Z4mul3
// CHECK-LABEL: define{{.*}} zeroext i16 @_Z4mul3
// CHECK: smul.with.overflow
ushort mul3(ushort us) { return us * us; }

// CHECK-LABEL: define i32 @_Z4mul4
// CHECK-LABEL: define{{.*}} i32 @_Z4mul4
// CHECK: smul.with.overflow
int mul4(int i, char c) { return i * c; }

// CHECK-LABEL: define i32 @_Z4mul5
// CHECK-LABEL: define{{.*}} i32 @_Z4mul5
// CHECK: smul.with.overflow
int mul5(int i, char c) { return c * i; }

// CHECK-LABEL: define signext i16 @_Z4mul6
// CHECK-LABEL: define{{.*}} signext i16 @_Z4mul6
// CHECK-NOT: smul.with.overflow
short mul6(short s) { return s * s; }

// CHECK-LABEL: define signext i8 @_Z4div1
// CHECK-LABEL: define{{.*}} signext i8 @_Z4div1
// CHECK-NOT: ubsan_handle_divrem_overflow
char div1(char c) { return c / c; }

// CHECK-LABEL: define zeroext i8 @_Z4div2
// CHECK-LABEL: define{{.*}} zeroext i8 @_Z4div2
// CHECK-NOT: ubsan_handle_divrem_overflow
uchar div2(uchar uc) { return uc / uc; }

// CHECK-LABEL: define signext i8 @_Z4div3
// CHECK-LABEL: define{{.*}} signext i8 @_Z4div3
// CHECK-NOT: ubsan_handle_divrem_overflow
char div3(char c, int i) { return c / i; }

// CHECK-LABEL: define signext i8 @_Z4div4
// CHECK-LABEL: define{{.*}} signext i8 @_Z4div4
// CHECK: ubsan_handle_divrem_overflow
char div4(int i, char c) { return i / c; }

// Note: INT_MIN / -1 can overflow.
//
// CHECK-LABEL: define signext i8 @_Z4div5
// CHECK-LABEL: define{{.*}} signext i8 @_Z4div5
// CHECK: ubsan_handle_divrem_overflow
char div5(int i, char c) { return i / c; }

// CHECK-LABEL: define signext i8 @_Z4rem1
// CHECK-LABEL: define{{.*}} signext i8 @_Z4rem1
// CHECK-NOT: ubsan_handle_divrem_overflow
char rem1(char c) { return c % c; }

// CHECK-LABEL: define zeroext i8 @_Z4rem2
// CHECK-LABEL: define{{.*}} zeroext i8 @_Z4rem2
// CHECK-NOT: ubsan_handle_divrem_overflow
uchar rem2(uchar uc) { return uc % uc; }

// CHECK-LABEL: define signext i8 @_Z4rem3
// CHECK-LABEL: define{{.*}} signext i8 @_Z4rem3
// CHECK: ubsan_handle_divrem_overflow
char rem3(int i, char c) { return i % c; }

// CHECK-LABEL: define signext i8 @_Z4rem4
// CHECK-LABEL: define{{.*}} signext i8 @_Z4rem4
// CHECK-NOT: ubsan_handle_divrem_overflow
char rem4(char c, int i) { return c % i; }

// CHECK-LABEL: define signext i8 @_Z4inc1
// CHECK-LABEL: define{{.*}} signext i8 @_Z4inc1
// CHECK-NOT: sadd.with.overflow
char inc1(char c) { return c++ + (char)0; }

// CHECK-LABEL: define zeroext i8 @_Z4inc2
// CHECK-LABEL: define{{.*}} zeroext i8 @_Z4inc2
// CHECK-NOT: uadd.with.overflow
uchar inc2(uchar uc) { return uc++ + (uchar)0; }

// CHECK-LABEL: define void @_Z4inc3
// CHECK-LABEL: define{{.*}} void @_Z4inc3
// CHECK-NOT: sadd.with.overflow
void inc3(char c) { c++; }

// CHECK-LABEL: define void @_Z4inc4
// CHECK-LABEL: define{{.*}} void @_Z4inc4
// CHECK-NOT: uadd.with.overflow
void inc4(uchar uc) { uc++; }

// CHECK-LABEL: define <4 x i32> @_Z4vremDv4_iS_
// CHECK-LABEL: define{{.*}} <4 x i32> @_Z4vremDv4_iS_
// CHECK-NOT: ubsan_handle_divrem_overflow
int4 vrem(int4 a, int4 b) { return a % b; }
12 changes: 6 additions & 6 deletions clang/test/CodeGen/ubsan-shift.c
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsanitize=shift-exponent,shift-base -emit-llvm %s -o - | FileCheck %s

// CHECK-LABEL: define i32 @f1
// CHECK-LABEL: define{{.*}} i32 @f1
int f1(int c, int shamt) {
// CHECK: icmp ule i32 %{{.*}}, 31, !nosanitize
// CHECK: icmp ule i32 %{{.*}}, 31, !nosanitize
return 1 << (c << shamt);
}

// CHECK-LABEL: define i32 @f2
// CHECK-LABEL: define{{.*}} i32 @f2
int f2(long c, int shamt) {
// CHECK: icmp ule i32 %{{.*}}, 63, !nosanitize
// CHECK: icmp ule i64 %{{.*}}, 31, !nosanitize
return 1 << (c << shamt);
}

// CHECK-LABEL: define i32 @f3
// CHECK-LABEL: define{{.*}} i32 @f3
unsigned f3(unsigned c, int shamt) {
// CHECK: icmp ule i32 %{{.*}}, 31, !nosanitize
// CHECK: icmp ule i32 %{{.*}}, 31, !nosanitize
return 1U << (c << shamt);
}

// CHECK-LABEL: define i32 @f4
// CHECK-LABEL: define{{.*}} i32 @f4
unsigned f4(unsigned long c, int shamt) {
// CHECK: icmp ule i32 %{{.*}}, 63, !nosanitize
// CHECK: icmp ule i64 %{{.*}}, 31, !nosanitize
return 1U << (c << shamt);
}

// CHECK-LABEL: define i32 @f5
// CHECK-LABEL: define{{.*}} i32 @f5
int f5(int c, long long shamt) {
// CHECK: icmp ule i64 %{{[0-9]+}}, 31, !nosanitize
//
Expand All @@ -37,7 +37,7 @@ int f5(int c, long long shamt) {
return c << shamt;
}

// CHECK-LABEL: define i32 @f6
// CHECK-LABEL: define{{.*}} i32 @f6
int f6(int c, int shamt) {
// CHECK: icmp ule i32 %[[WIDTH:.*]], 31, !nosanitize
//
Expand Down
20 changes: 10 additions & 10 deletions clang/test/CodeGen/unsigned-overflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ unsigned int ii, ij, ik;
extern void opaquelong(unsigned long);
extern void opaqueint(unsigned int);

// CHECK-LABEL: define void @testlongadd()
// CHECK-LABEL: define{{.*}} void @testlongadd()
void testlongadd() {

// CHECK: [[T1:%.*]] = load i64, i64* @lj
Expand All @@ -20,7 +20,7 @@ void testlongadd() {
li = lj + lk;
}

// CHECK-LABEL: define void @testlongsub()
// CHECK-LABEL: define{{.*}} void @testlongsub()
void testlongsub() {

// CHECK: [[T1:%.*]] = load i64, i64* @lj
Expand All @@ -32,7 +32,7 @@ void testlongsub() {
li = lj - lk;
}

// CHECK-LABEL: define void @testlongmul()
// CHECK-LABEL: define{{.*}} void @testlongmul()
void testlongmul() {

// CHECK: [[T1:%.*]] = load i64, i64* @lj
Expand All @@ -44,7 +44,7 @@ void testlongmul() {
li = lj * lk;
}

// CHECK-LABEL: define void @testlongpostinc()
// CHECK-LABEL: define{{.*}} void @testlongpostinc()
void testlongpostinc() {
opaquelong(li++);

Expand All @@ -55,7 +55,7 @@ void testlongpostinc() {
// CHECK: call void @__ubsan_handle_add_overflow
}

// CHECK-LABEL: define void @testlongpreinc()
// CHECK-LABEL: define{{.*}} void @testlongpreinc()
void testlongpreinc() {
opaquelong(++li);

Expand All @@ -66,7 +66,7 @@ void testlongpreinc() {
// CHECK: call void @__ubsan_handle_add_overflow
}

// CHECK-LABEL: define void @testintadd()
// CHECK-LABEL: define{{.*}} void @testintadd()
void testintadd() {

// CHECK: [[T1:%.*]] = load i32, i32* @ij
Expand All @@ -78,7 +78,7 @@ void testintadd() {
ii = ij + ik;
}

// CHECK-LABEL: define void @testintsub()
// CHECK-LABEL: define{{.*}} void @testintsub()
void testintsub() {

// CHECK: [[T1:%.*]] = load i32, i32* @ij
Expand All @@ -90,7 +90,7 @@ void testintsub() {
ii = ij - ik;
}

// CHECK-LABEL: define void @testintmul()
// CHECK-LABEL: define{{.*}} void @testintmul()
void testintmul() {

// CHECK: [[T1:%.*]] = load i32, i32* @ij
Expand All @@ -102,7 +102,7 @@ void testintmul() {
ii = ij * ik;
}

// CHECK-LABEL: define void @testintpostinc()
// CHECK-LABEL: define{{.*}} void @testintpostinc()
void testintpostinc() {
opaqueint(ii++);

Expand All @@ -113,7 +113,7 @@ void testintpostinc() {
// CHECK: call void @__ubsan_handle_add_overflow
}

// CHECK-LABEL: define void @testintpreinc()
// CHECK-LABEL: define{{.*}} void @testintpreinc()
void testintpreinc() {
opaqueint(++ii);

Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/unsigned-promotion.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

unsigned short si, sj, sk;

// CHECKS-LABEL: define void @testshortmul()
// CHECKU-LABEL: define void @testshortmul()
// CHECKS-LABEL: define{{.*}} void @testshortmul()
// CHECKU-LABEL: define{{.*}} void @testshortmul()
void testshortmul() {

// CHECKS: load i16, i16* @sj
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ vec_int1 lax_vector_compare1(int x, vec_int1 y) {
return y;
}

// CHECK: define i32 @lax_vector_compare1(i32 {{.*}}, i32 {{.*}})
// CHECK: define{{.*}} i32 @lax_vector_compare1(i32 {{.*}}, i32 {{.*}})
// CHECK: icmp eq i32

typedef int vec_int2 __attribute__((vector_size(8)));
Expand All @@ -78,5 +78,5 @@ vec_int2 lax_vector_compare2(long long x, vec_int2 y) {
return y;
}

// CHECK: define void @lax_vector_compare2(<2 x i32>* {{.*sret.*}}, i64 {{.*}}, i64 {{.*}})
// CHECK: define{{.*}} void @lax_vector_compare2(<2 x i32>* {{.*sret.*}}, i64 {{.*}}, i64 {{.*}})
// CHECK: icmp eq <2 x i32>
4 changes: 2 additions & 2 deletions clang/test/CodeGen/volatile-2.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s

void test0() {
// CHECK-LABEL: define void @test0()
// CHECK-LABEL: define{{.*}} void @test0()
// CHECK: [[F:%.*]] = alloca float
// CHECK-NEXT: [[REAL:%.*]] = load volatile float, float* getelementptr inbounds ({ float, float }, { float, float }* @test0_v, i32 0, i32 0), align 4
// CHECK-NEXT: load volatile float, float* getelementptr inbounds ({{.*}} @test0_v, i32 0, i32 1), align 4
Expand All @@ -12,7 +12,7 @@ void test0() {
}

void test1() {
// CHECK-LABEL: define void @test1()
// CHECK-LABEL: define{{.*}} void @test1()
// CHECK: [[REAL:%.*]] = load volatile float, float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
// CHECK-NEXT: [[IMAG:%.*]] = load volatile float, float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 1), align 4
// CHECK-NEXT: store volatile float [[REAL]], float* getelementptr inbounds ({{.*}} @test1_v, i32 0, i32 0), align 4
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenCXX/DynArrayInit.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %clang_cc1 -triple x86_64-apple-darwin10 -O3 -emit-llvm -o - %s | FileCheck %s
// PR7490

// CHECK-LABEL: define signext i8 @_Z2f0v
// CHECK-LABEL: define{{.*}} signext i8 @_Z2f0v
// CHECK: ret i8 0
// CHECK: }
inline void* operator new[](unsigned long, void* __p) { return __p; }
Expand Down
8 changes: 4 additions & 4 deletions clang/test/CodeGenCXX/abstract-class-ctors-dtors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ struct A {
~A();
};

// CHECK-NOT: define void @_ZN1AC1Ev
// CHECK-LABEL: define void @_ZN1AC2Ev
// CHECK-LABEL: define void @_ZN1AD2Ev
// CHECK-LABEL: define void @_ZN1AD1Ev
// CHECK-NOT: define{{.*}} void @_ZN1AC1Ev
// CHECK-LABEL: define{{.*}} void @_ZN1AC2Ev
// CHECK-LABEL: define{{.*}} void @_ZN1AD2Ev
// CHECK-LABEL: define{{.*}} void @_ZN1AD1Ev
A::A() { }

A::~A() { }
8 changes: 4 additions & 4 deletions clang/test/CodeGenCXX/address-space-ref.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ a & foo(a &x, a & y) {
return x;
}

// CHECK: define align 4 dereferenceable(4) i32 addrspace(1)* @_Z3fooRU3AS1iS0_(i32 addrspace(1)* align 4 dereferenceable(4) %x, i32 addrspace(1)* align 4 dereferenceable(4) %y)
// CHECK: define{{.*}} align 4 dereferenceable(4) i32 addrspace(1)* @_Z3fooRU3AS1iS0_(i32 addrspace(1)* align 4 dereferenceable(4) %x, i32 addrspace(1)* align 4 dereferenceable(4) %y)

// For a reference to an incomplete type in an alternate address space, output
// neither dereferenceable nor nonnull.
Expand All @@ -22,15 +22,15 @@ b & bar(b &x, b & y) {
return x;
}

// CHECK: define align 1 %class.bc addrspace(1)* @_Z3barRU3AS12bcS1_(%class.bc addrspace(1)* align 1 %x, %class.bc addrspace(1)* align 1 %y)
// CHECK: define{{.*}} align 1 %class.bc addrspace(1)* @_Z3barRU3AS12bcS1_(%class.bc addrspace(1)* align 1 %x, %class.bc addrspace(1)* align 1 %y)

// For a reference to an incomplete type in addrspace(0), output nonnull.

bc & bar2(bc &x, bc & y) {
return x;
}

// NULL-INVALID: define nonnull align 1 %class.bc* @_Z4bar2R2bcS0_(%class.bc* nonnull align 1 %x, %class.bc* nonnull align 1 %y)
// NULL-VALID: define align 1 %class.bc* @_Z4bar2R2bcS0_(%class.bc* align 1 %x, %class.bc* align 1 %y)
// NULL-INVALID: define{{.*}} nonnull align 1 %class.bc* @_Z4bar2R2bcS0_(%class.bc* nonnull align 1 %x, %class.bc* nonnull align 1 %y)
// NULL-VALID: define{{.*}} align 1 %class.bc* @_Z4bar2R2bcS0_(%class.bc* align 1 %x, %class.bc* align 1 %y)


10 changes: 5 additions & 5 deletions clang/test/CodeGenCXX/alloc-size.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ template <typename T> int callMalloc();

template <typename T, int N> int callCalloc();

// CHECK-LABEL: define i32 @_ZN9templates6testItEv()
// CHECK-LABEL: define{{.*}} i32 @_ZN9templates6testItEv()
int testIt() {
// CHECK: call i32 @_ZN9templates10callMallocINS_6MyTypeEEEiv
// CHECK: call i32 @_ZN9templates10callCallocINS_6MyTypeELi4EEEiv
Expand Down Expand Up @@ -59,7 +59,7 @@ template <typename T, size_t M>
void *dependent_calloc2(size_t NT = sizeof(T), size_t MT = M)
__attribute__((alloc_size(1, 2)));

// CHECK-LABEL: define i32 @_ZN20templated_alloc_size6testItEv
// CHECK-LABEL: define{{.*}} i32 @_ZN20templated_alloc_size6testItEv
int testIt() {
// 122 = 4 + 5*4 + 6 + 7*8 + 4*9
// CHECK: ret i32 122
Expand All @@ -79,7 +79,7 @@ struct Foo {

void *my_malloc(const Foo &, int N) __attribute__((alloc_size(2)));

// CHECK-LABEL: define i32 @_ZN24alloc_size_with_cleanups6testItEv
// CHECK-LABEL: define{{.*}} i32 @_ZN24alloc_size_with_cleanups6testItEv
int testIt() {
int *const p = (int *)my_malloc(Foo{}, 3);
// CHECK: ret i32 3
Expand All @@ -93,13 +93,13 @@ class C {
void *my_calloc(int N, int M) __attribute__((alloc_size(2, 3)));
};

// CHECK-LABEL: define i32 @_Z16callMemberMallocv
// CHECK-LABEL: define{{.*}} i32 @_Z16callMemberMallocv
int callMemberMalloc() {
// CHECK: ret i32 16
return __builtin_object_size(C().my_malloc(16), 0);
}

// CHECK-LABEL: define i32 @_Z16callMemberCallocv
// CHECK-LABEL: define{{.*}} i32 @_Z16callMemberCallocv
int callMemberCalloc() {
// CHECK: ret i32 32
return __builtin_object_size(C().my_calloc(16, 2), 0);
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGenCXX/anonymous-namespaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace test2 {
struct C;
}

// CHECK-2-LABEL: define void @_ZN5test24testEv()
// CHECK-2-LABEL: define{{.*}} void @_ZN5test24testEv()
// CHECK-2: call void @_ZN5test21A1BINS_12_GLOBAL__N_11CEE3fooEv()
void test() {
A::B<C>::foo();
Expand Down
Loading