forked from OSchip/llvm-project
Add checks for format specifiers used by __builtin_dump_struct and added a new specifier for null-terminated constant strings.
Patch by Paul Semel. llvm-svn: 330185
This commit is contained in:
parent
6a4a524146
commit
b6a7702297
|
@ -962,6 +962,7 @@ static llvm::Value *dumpRecord(CodeGenFunction &CGF, QualType RType,
|
|||
Types[Context.DoubleTy] = "%f";
|
||||
Types[Context.LongDoubleTy] = "%Lf";
|
||||
Types[Context.getPointerType(Context.CharTy)] = "%s";
|
||||
Types[Context.getPointerType(Context.getConstType(Context.CharTy))] = "%s";
|
||||
}
|
||||
|
||||
for (const auto *FD : RD->fields()) {
|
||||
|
|
|
@ -2,6 +2,98 @@
|
|||
|
||||
#include "Inputs/stdio.h"
|
||||
|
||||
// CHECK: @unit1.a = private unnamed_addr constant %struct.U1A { i16 12 }, align 2
|
||||
// CHECK-NEXT: [[STRUCT_STR_U1:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U1A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U1:@[0-9]+]] = private unnamed_addr constant [11 x i8] c"short a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U1:@[0-9]+]] = private unnamed_addr constant [5 x i8] c"%hd\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U1:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit2.a = private unnamed_addr constant %struct.U2A { i16 12 }, align 2
|
||||
// CHECK-NEXT: [[STRUCT_STR_U2:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U2A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U2:@[0-9]+]] = private unnamed_addr constant [20 x i8] c"unsigned short a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U2:@[0-9]+]] = private unnamed_addr constant [5 x i8] c"%hu\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U2:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit3.a = private unnamed_addr constant %struct.U3A { i32 12 }, align 4
|
||||
// CHECK-NEXT: [[STRUCT_STR_U3:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U3A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U3:@[0-9]+]] = private unnamed_addr constant [9 x i8] c"int a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U3:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%d\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U3:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit4.a = private unnamed_addr constant %struct.U4A { i32 12 }, align 4
|
||||
// CHECK-NEXT: [[STRUCT_STR_U4:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U4A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U4:@[0-9]+]] = private unnamed_addr constant [18 x i8] c"unsigned int a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U4:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%u\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U4:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit5.a = private unnamed_addr constant %struct.U5A { i64 12 }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U5:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U5A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U5:@[0-9]+]] = private unnamed_addr constant [10 x i8] c"long a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U5:@[0-9]+]] = private unnamed_addr constant [5 x i8] c"%ld\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U5:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit6.a = private unnamed_addr constant %struct.U6A { i64 12 }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U6:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U6A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U6:@[0-9]+]] = private unnamed_addr constant [19 x i8] c"unsigned long a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U6:@[0-9]+]] = private unnamed_addr constant [5 x i8] c"%lu\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U6:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit7.a = private unnamed_addr constant %struct.U7A { i64 12 }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U7:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U7A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U7:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"long long a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U7:@[0-9]+]] = private unnamed_addr constant [6 x i8] c"%lld\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U7:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit8.a = private unnamed_addr constant %struct.U8A { i64 12 }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U8:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U8A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U8:@[0-9]+]] = private unnamed_addr constant [24 x i8] c"unsigned long long a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U8:@[0-9]+]] = private unnamed_addr constant [6 x i8] c"%llu\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U8:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit9.a = private unnamed_addr constant %struct.U9A { i8 97 }, align 1
|
||||
// CHECK-NEXT: [[STRUCT_STR_U9:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"struct U9A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U9:@[0-9]+]] = private unnamed_addr constant [10 x i8] c"char a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U9:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%c\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U9:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @.str = private unnamed_addr constant [4 x i8] c"LSE\00", align 1
|
||||
|
||||
// CHECK: @unit10.a = private unnamed_addr constant %struct.U10A { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0) }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U10:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U10A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U10:@[0-9]+]] = private unnamed_addr constant [12 x i8] c"char * a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U10:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%s\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U10:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit11.a = private unnamed_addr constant %struct.U11A { i8* inttoptr (i64 305419896 to i8*) }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U11:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U11A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U11:@[0-9]+]] = private unnamed_addr constant [12 x i8] c"void * a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U11:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%p\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U11:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit12.a = private unnamed_addr constant %struct.U12A { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0) }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U12:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U12A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U12:@[0-9]+]] = private unnamed_addr constant [18 x i8] c"const char * a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U12:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%s\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U12:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit13.a = private unnamed_addr constant %struct.U13A { i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0) }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U13:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U13A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U13:@[0-9]+]] = private unnamed_addr constant [20 x i8] c"const charstar a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U13:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%s\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U13:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit14.a = private unnamed_addr constant %struct.U14A { double 0x3FF1F9ACFFA7EB6C }, align 8
|
||||
// CHECK-NEXT: [[STRUCT_STR_U14:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U14A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U14:@[0-9]+]] = private unnamed_addr constant [12 x i8] c"double a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U14:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%f\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U14:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
// CHECK: @unit15.a = private unnamed_addr constant %struct.U15A { [3 x i32] [i32 1, i32 2, i32 3] }, align 4
|
||||
// CHECK-NEXT: [[STRUCT_STR_U15:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U15A {\0A\00"
|
||||
// CHECK-NEXT: [[FIELD_U15:@[0-9]+]] = private unnamed_addr constant [13 x i8] c"int [3] a : \00"
|
||||
// CHECK-NEXT: [[FORMAT_U15:@[0-9]+]] = private unnamed_addr constant [4 x i8] c"%p\0A\00"
|
||||
// CHECK-NEXT: [[END_STRUCT_U15:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00"
|
||||
|
||||
int printf(const char *fmt, ...) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -14,13 +106,12 @@ void unit1() {
|
|||
struct U1A a = {
|
||||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U1]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U1A, %struct.U1A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* [[FIELD_U1]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i16, i16* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i16 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* [[FORMAT_U1]], i32 0, i32 0), i16 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U1]], i32 0, i32 0))
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -33,12 +124,12 @@ void unit2() {
|
|||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U2]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U2A, %struct.U2A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* [[FIELD_U2]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i16, i16* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i16 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* [[FORMAT_U2]], i32 0, i32 0), i16 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U2]], i32 0, i32 0))
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -51,12 +142,12 @@ void unit3() {
|
|||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U3]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U3A, %struct.U3A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* [[FIELD_U3]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i32, i32* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i32 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U3]], i32 0, i32 0), i32 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U3]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -69,12 +160,12 @@ void unit4() {
|
|||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U4]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U4A, %struct.U4A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* [[FIELD_U4]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i32, i32* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i32 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U4]], i32 0, i32 0), i32 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U4]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -87,12 +178,12 @@ void unit5() {
|
|||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U5]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U5A, %struct.U5A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* [[FIELD_U5]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* [[FORMAT_U5]], i32 0, i32 0), i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U5]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -105,12 +196,12 @@ void unit6() {
|
|||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U6]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U6A, %struct.U6A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[FIELD_U6]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* [[FORMAT_U6]], i32 0, i32 0), i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U6]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -123,30 +214,30 @@ void unit7() {
|
|||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U7]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U7A, %struct.U7A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[FIELD_U7]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* [[FORMAT_U7]], i32 0, i32 0), i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U7]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
void unit8() {
|
||||
struct U8A {
|
||||
long long a;
|
||||
unsigned long long a;
|
||||
};
|
||||
|
||||
struct U8A a = {
|
||||
.a = 12,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U8]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U8A, %struct.U8A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* [[FIELD_U8]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* [[FORMAT_U8]], i32 0, i32 0), i64 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U8]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -159,12 +250,12 @@ void unit9() {
|
|||
.a = 'a',
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U9]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U9A, %struct.U9A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* [[FIELD_U9]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i8, i8* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i8 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U9]], i32 0, i32 0), i8 [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U9]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -177,12 +268,12 @@ void unit10() {
|
|||
.a = "LSE",
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U10]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U10A, %struct.U10A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* [[FIELD_U10]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U10]], i32 0, i32 0), i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U10]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -195,12 +286,12 @@ void unit11() {
|
|||
.a = (void *)0x12345678,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U11]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U11A, %struct.U11A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* [[FIELD_U11]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U11]], i32 0, i32 0), i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U11]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -213,12 +304,12 @@ void unit12() {
|
|||
.a = "LSE",
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U12]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U12A, %struct.U12A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* [[FIELD_U12]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U12]], i32 0, i32 0), i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U12]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -232,12 +323,12 @@ void unit13() {
|
|||
.a = "LSE",
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U13]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U13A, %struct.U13A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* [[FIELD_U13]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U13]], i32 0, i32 0), i8* [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U13]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -250,12 +341,12 @@ void unit14() {
|
|||
.a = 1.123456,
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U14]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U14A, %struct.U14A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* [[FIELD_U14]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load double, double* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, double [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U14]], i32 0, i32 0), double [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U14]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
@ -268,12 +359,12 @@ void unit15() {
|
|||
.a = {1, 2, 3},
|
||||
};
|
||||
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U15]], i32 0, i32 0))
|
||||
// CHECK: [[RES1:%[0-9]+]] = getelementptr inbounds %struct.U15A, %struct.U15A* %a, i32 0, i32 0
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* [[FIELD_U15]], i32 0, i32 0))
|
||||
// CHECK: [[LOAD1:%[0-9]+]] = load [3 x i32], [3 x i32]* [[RES1]],
|
||||
// CHECK: call i32 (i8*, ...) @printf({{.*}}, [3 x i32] [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[FORMAT_U15]], i32 0, i32 0), [3 x i32] [[LOAD1]])
|
||||
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U15]], i32 0, i32 0)
|
||||
__builtin_dump_struct(&a, &printf);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue