[Clang][CodeGen]Beautify dump format, add indent for nested struct and struct members

Beautify dump format, add indent for nested struct and struct members, also fix test cases in dump-struct-builtin.c
for example:
struct:
```
  struct A {
    int a;
    struct B {
      int b;
      struct C {
        struct D {
          int d;
          union E {
            int x;
            int y;
          } e;
        } d;
        int c;
      } c;
    } b;
  };
```
Before:
```
struct A {
int a = 0
struct B {
    int b = 0
struct C {
struct D {
            int d = 0
union E {
                int x = 0
                int y = 0
                }
            }
        int c = 0
        }
    }
}
```
After:
```
struct A {
    int a = 0
    struct B {
        int b = 0
        struct C {
            struct D {
                int d = 0
                union E {
                    int x = 0
                    int y = 0
                }
            }
            int c = 0
        }
    }
}
```

Reviewed By: erichkeane

Differential Revision: https://reviews.llvm.org/D122704
This commit is contained in:
wangyihan 2022-03-31 07:38:37 +08:00
parent a5466f0436
commit 907d3acefc
3 changed files with 145 additions and 143 deletions

View File

@ -117,6 +117,7 @@ Non-comprehensive list of changes in this release
- Support bitfields in struct and union.
- Improve the dump format, dump both bitwidth(if its a bitfield) and field value.
- Remove anonymous tag locations.
- Beautify dump format, add indent for nested struct and struct members.
New Compiler Flags
------------------

View File

@ -2049,11 +2049,12 @@ static llvm::Value *dumpRecord(CodeGenFunction &CGF, QualType RType,
ASTContext &Context = CGF.getContext();
RecordDecl *RD = RType->castAs<RecordType>()->getDecl()->getDefinition();
std::string Pad = std::string(Lvl * 4, ' ');
std::string ElementPad = std::string((Lvl + 1) * 4, ' ');
PrintingPolicy Policy(Context.getLangOpts());
Policy.AnonymousTagLocations = false;
Value *GString =
CGF.Builder.CreateGlobalStringPtr(RType.getAsString(Policy) + " {\n");
Value *GString = CGF.Builder.CreateGlobalStringPtr(
llvm::Twine(Pad).concat(RType.getAsString(Policy)).concat(" {\n").str());
Value *Res = CGF.Builder.CreateCall(Func, {GString});
static llvm::DenseMap<QualType, const char *> Types;
@ -2081,7 +2082,7 @@ static llvm::Value *dumpRecord(CodeGenFunction &CGF, QualType RType,
for (const auto *FD : RD->fields()) {
Value *TmpRes = nullptr;
std::string Format = llvm::Twine(Pad)
std::string Format = llvm::Twine(ElementPad)
.concat(FD->getType().getAsString())
.concat(llvm::Twine(' '))
.concat(FD->getNameAsString())

View File

@ -5,93 +5,93 @@
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U1:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"short a = %hd\0A\00", align 1
// CHECK-NEXT: [[FIELD_U1:@[0-9]+]] = private unnamed_addr constant [19 x i8] c" short a = %hd\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U1:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U2:@[0-9]+]] = private unnamed_addr constant [24 x i8] c"unsigned short a = %hu\0A\00", align 1
// CHECK-NEXT: [[FIELD_U2:@[0-9]+]] = private unnamed_addr constant [28 x i8] c" unsigned short a = %hu\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U2:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U3:@[0-9]+]] = private unnamed_addr constant [12 x i8] c"int a = %d\0A\00", align 1
// CHECK-NEXT: [[FIELD_U3:@[0-9]+]] = private unnamed_addr constant [16 x i8] c" int a = %d\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U3:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U4:@[0-9]+]] = private unnamed_addr constant [21 x i8] c"unsigned int a = %u\0A\00", align 1
// CHECK-NEXT: [[FIELD_U4:@[0-9]+]] = private unnamed_addr constant [25 x i8] c" unsigned int a = %u\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U4:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U5:@[0-9]+]] = private unnamed_addr constant [14 x i8] c"long a = %ld\0A\00", align 1
// CHECK-NEXT: [[FIELD_U5:@[0-9]+]] = private unnamed_addr constant [18 x i8] c" long a = %ld\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U5:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U6:@[0-9]+]] = private unnamed_addr constant [23 x i8] c"unsigned long a = %lu\0A\00", align 1
// CHECK-NEXT: [[FIELD_U6:@[0-9]+]] = private unnamed_addr constant [27 x i8] c" unsigned long a = %lu\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U6:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U7:@[0-9]+]] = private unnamed_addr constant [20 x i8] c"long long a = %lld\0A\00", align 1
// CHECK-NEXT: [[FIELD_U7:@[0-9]+]] = private unnamed_addr constant [24 x i8] c" long long a = %lld\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U7:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U8:@[0-9]+]] = private unnamed_addr constant [29 x i8] c"unsigned long long a = %llu\0A\00", align 1
// CHECK-NEXT: [[FIELD_U8:@[0-9]+]] = private unnamed_addr constant [33 x i8] c" unsigned long long a = %llu\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U8:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U9:@[0-9]+]] = private unnamed_addr constant [13 x i8] c"char a = %c\0A\00", align 1
// CHECK-NEXT: [[FIELD_U9:@[0-9]+]] = private unnamed_addr constant [17 x i8] c" char a = %c\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U9:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @.str = private unnamed_addr constant [4 x i8] c"LSE\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U10:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"char * a = %s\0A\00", align 1
// CHECK-NEXT: [[FIELD_U10:@[0-9]+]] = private unnamed_addr constant [19 x i8] c" char * a = %s\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U10:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U11:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"void * a = %p\0A\00", align 1
// CHECK-NEXT: [[FIELD_U11:@[0-9]+]] = private unnamed_addr constant [19 x i8] c" void * a = %p\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U11:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U12:@[0-9]+]] = private unnamed_addr constant [21 x i8] c"const char * a = %s\0A\00", align 1
// CHECK-NEXT: [[FIELD_U12:@[0-9]+]] = private unnamed_addr constant [25 x i8] c" const char * a = %s\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U12:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U13:@[0-9]+]] = private unnamed_addr constant [23 x i8] c"const charstar a = %s\0A\00", align 1
// CHECK-NEXT: [[FIELD_U13:@[0-9]+]] = private unnamed_addr constant [27 x i8] c" const charstar a = %s\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U13:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U14:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"double a = %f\0A\00", align 1
// CHECK-NEXT: [[FIELD_U14:@[0-9]+]] = private unnamed_addr constant [19 x i8] c" double a = %f\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U14:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.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", align 1
// CHECK-NEXT: [[FIELD_U15:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"int[3] a = %p\0A\00", align 1
// CHECK-NEXT: [[FIELD_U15:@[0-9]+]] = private unnamed_addr constant [19 x i8] c" int[3] a = %p\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U15:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.unit16.a = private unnamed_addr constant %struct.U16A { i8 12 }, align 1
// CHECK-NEXT: [[STRUCT_STR_U16:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U16A {\0A\00", align 1
// CHECK-NEXT: [[FIELD_U16:@[0-9]+]] = private unnamed_addr constant [18 x i8] c"uint8_t a = %hhu\0A\00", align 1
// CHECK-NEXT: [[FIELD_U16:@[0-9]+]] = private unnamed_addr constant [22 x i8] c" uint8_t a = %hhu\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U16:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.unit17.a = private unnamed_addr constant %struct.U17A { i8 12 }, align 1
// CHECK-NEXT: [[STRUCT_STR_U17:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U17A {\0A\00", align 1
// CHECK-NEXT: [[FIELD_U17:@[0-9]+]] = private unnamed_addr constant [17 x i8] c"int8_t a = %hhd\0A\00", align 1
// CHECK-NEXT: [[FIELD_U17:@[0-9]+]] = private unnamed_addr constant [21 x i8] c" int8_t a = %hhd\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U17:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
// CHECK: @__const.unit18.a = private unnamed_addr constant %struct.U18A { x86_fp80 0xK3FFF8FCD67FD3F5B6000 }, align 16
// CHECK-NEXT: [[STRUCT_STR_U18:@[0-9]+]] = private unnamed_addr constant [15 x i8] c"struct U18A {\0A\00", align 1
// CHECK-NEXT: [[FIELD_U18:@[0-9]+]] = private unnamed_addr constant [21 x i8] c"long double a = %Lf\0A\00", align 1
// CHECK-NEXT: [[FIELD_U18:@[0-9]+]] = private unnamed_addr constant [25 x i8] c" long double a = %Lf\0A\00", align 1
// CHECK-NEXT: [[END_STRUCT_U18:@[0-9]+]] = private unnamed_addr constant [3 x i8] c"}\0A\00", align 1
int printf(const char *fmt, ...) {
@ -107,9 +107,9 @@ void unit1(void) {
.a = 12,
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U1]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U1A, %struct.U1A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i16, i16* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[FIELD_U1]], i32 0, i32 0), i16 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U1A, %struct.U1A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i16, i16* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[FIELD_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);
}
@ -124,9 +124,9 @@ void unit2(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U2]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U2A, %struct.U2A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i16, i16* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* [[FIELD_U2]], i32 0, i32 0), i16 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U2A, %struct.U2A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i16, i16* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* [[FIELD_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);
}
@ -141,9 +141,9 @@ void unit3(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U3]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U3A, %struct.U3A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i32, i32* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* [[FIELD_U3]], i32 0, i32 0), i32 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U3A, %struct.U3A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i32, i32* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* [[FIELD_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);
}
@ -158,9 +158,9 @@ void unit4(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U4]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U4A, %struct.U4A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i32, i32* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[FIELD_U4]], i32 0, i32 0), i32 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U4A, %struct.U4A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i32, i32* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* [[FIELD_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);
}
@ -175,9 +175,9 @@ void unit5(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U5]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U5A, %struct.U5A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[FIELD_U5]], i32 0, i32 0), i64 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U5A, %struct.U5A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* [[FIELD_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);
}
@ -192,9 +192,9 @@ void unit6(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U6]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U6A, %struct.U6A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[FIELD_U6]], i32 0, i32 0), i64 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U6A, %struct.U6A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* [[FIELD_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);
}
@ -209,9 +209,9 @@ void unit7(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U7]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U7A, %struct.U7A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* [[FIELD_U7]], i32 0, i32 0), i64 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U7A, %struct.U7A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* [[FIELD_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);
}
@ -226,9 +226,9 @@ void unit8(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U8]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U8A, %struct.U8A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* [[FIELD_U8]], i32 0, i32 0), i64 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U8A, %struct.U8A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i64, i64* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* [[FIELD_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);
}
@ -243,9 +243,9 @@ void unit9(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* [[STRUCT_STR_U9]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U9A, %struct.U9A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8, i8* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* [[FIELD_U9]], i32 0, i32 0), i8 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U9A, %struct.U9A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8, i8* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* [[FIELD_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);
}
@ -260,9 +260,9 @@ void unit10(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U10]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U10A, %struct.U10A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[FIELD_U10]], i32 0, i32 0), i8* [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U10A, %struct.U10A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[FIELD_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);
}
@ -277,9 +277,9 @@ void unit11(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U11]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U11A, %struct.U11A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[FIELD_U11]], i32 0, i32 0), i8* [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U11A, %struct.U11A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[FIELD_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);
}
@ -294,9 +294,9 @@ void unit12(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U12]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U12A, %struct.U12A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[FIELD_U12]], i32 0, i32 0), i8* [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U12A, %struct.U12A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* [[FIELD_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);
}
@ -312,9 +312,9 @@ void unit13(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U13]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U13A, %struct.U13A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* [[FIELD_U13]], i32 0, i32 0), i8* [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U13A, %struct.U13A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8*, i8** [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* [[FIELD_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);
}
@ -329,9 +329,9 @@ void unit14(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U14]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U14A, %struct.U14A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load double, double* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[FIELD_U14]], i32 0, i32 0), double [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U14A, %struct.U14A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load double, double* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[FIELD_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);
}
@ -346,9 +346,9 @@ void unit15(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U15]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U15A, %struct.U15A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load [3 x i32], [3 x i32]* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[FIELD_U15]], i32 0, i32 0), [3 x i32] [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U15A, %struct.U15A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load [3 x i32], [3 x i32]* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* [[FIELD_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);
}
@ -363,9 +363,9 @@ void unit16(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U16]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U16A, %struct.U16A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8, i8* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* [[FIELD_U16]], i32 0, i32 0), i8 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U16A, %struct.U16A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8, i8* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* [[FIELD_U16]], i32 0, i32 0), i8 [[LOAD1]])
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U16]], i32 0, i32 0)
__builtin_dump_struct(&a, &printf);
}
@ -380,9 +380,9 @@ void unit17(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U17]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U17A, %struct.U17A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8, i8* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* [[FIELD_U17]], i32 0, i32 0), i8 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U17A, %struct.U17A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8, i8* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[FIELD_U17]], i32 0, i32 0), i8 [[LOAD1]])
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U17]], i32 0, i32 0)
__builtin_dump_struct(&a, &printf);
}
@ -397,9 +397,9 @@ void unit18(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* [[STRUCT_STR_U18]], i32 0, i32 0))
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.U18A, %struct.U18A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load x86_fp80, x86_fp80* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[FIELD_U18]], i32 0, i32 0), x86_fp80 [[LOAD1]])
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.U18A, %struct.U18A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load x86_fp80, x86_fp80* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* [[FIELD_U18]], i32 0, i32 0), x86_fp80 [[LOAD1]])
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[END_STRUCT_U18]], i32 0, i32 0)
__builtin_dump_struct(&a, &printf);
}
@ -416,11 +416,11 @@ void test1(void) {
};
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES1:%[a-z0-9]+]] = getelementptr inbounds %struct.T1A, %struct.T1A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i32, i32* [[RES1]],
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.T1A, %struct.T1A* %a, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i32, i32* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i32 [[LOAD1]])
// CHECK: [[RES2:%[a-z0-9]+]] = getelementptr inbounds %struct.T1A, %struct.T1A* %a, i32 0, i32 1
// CHECK: [[LOAD2:%[0-9]+]] = load i8*, i8** [[RES2]],
// CHECK: [[RES2:%.*]] = getelementptr inbounds %struct.T1A, %struct.T1A* %a, i32 0, i32 1
// CHECK: [[LOAD2:%.*]] = load i8*, i8** [[RES2]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i8* [[LOAD2]])
// CHECK: call i32 (i8*, ...) @printf(
__builtin_dump_struct(&a, &printf);
@ -444,13 +444,13 @@ void test2(void) {
};
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES1:%[a-z0-9]+]] = getelementptr inbounds %struct.T2B, %struct.T2B* %b, i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i32, i32* [[RES1]],
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.T2B, %struct.T2B* %b, i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i32, i32* [[RES1]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i32 [[LOAD1]])
// CHECK: [[NESTED_STRUCT:%[a-z0-9]+]] = getelementptr inbounds %struct.T2B, %struct.T2B* %b, i32 0, i32 1
// CHECK: [[NESTED_STRUCT:%.*]] = getelementptr inbounds %struct.T2B, %struct.T2B* %b, i32 0, i32 1
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES2:%[a-z0-9]+]] = getelementptr inbounds %struct.T2A, %struct.T2A* [[NESTED_STRUCT]], i32 0, i32 0
// CHECK: [[LOAD2:%[0-9]+]] = load i32, i32* [[RES2]],
// CHECK: [[RES2:%.*]] = getelementptr inbounds %struct.T2A, %struct.T2A* [[NESTED_STRUCT]], i32 0, i32 0
// CHECK: [[LOAD2:%.*]] = load i32, i32* [[RES2]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i32 [[LOAD2]])
// CHECK: call i32 (i8*, ...) @printf(
__builtin_dump_struct(&b, &printf);
@ -469,13 +469,13 @@ void test3(void) {
};
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES1:%[a-z0-9]+]] = getelementptr inbounds %struct.T3A, %struct.T3A* %a, i32 0, i32 0
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.T3A, %struct.T3A* %a, i32 0, i32 0
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[BC1:%[a-z0-9]+]] = bitcast %union.anon* [[RES1]] to i32*
// CHECK: [[LOAD1:%[0-9]+]] = load i32, i32* [[BC1]],
// CHECK: [[BC1:%.*]] = bitcast %union.anon* [[RES1]] to i32*
// CHECK: [[LOAD1:%.*]] = load i32, i32* [[BC1]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i32 [[LOAD1]])
// CHECK: [[BC2:%[a-z0-9]+]] = bitcast %union.anon* [[RES1]] to [4 x i8]*
// CHECK: [[LOAD2:%[0-9]+]] = load [4 x i8], [4 x i8]* [[BC2]],
// CHECK: [[BC2:%.*]] = bitcast %union.anon* [[RES1]] to [4 x i8]*
// CHECK: [[LOAD2:%.*]] = load [4 x i8], [4 x i8]* [[BC2]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, [4 x i8] [[LOAD2]])
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: call i32 (i8*, ...) @printf(
@ -499,18 +499,18 @@ void test4(void) {
};
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES1:%[a-z0-9]+]] = getelementptr inbounds %struct.T4A, %struct.T4A* %a, i32 0, i32 0
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.T4A, %struct.T4A* %a, i32 0, i32 0
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[BC1:%[a-z0-9]+]] = bitcast %union.anon.0* [[RES1]] to %struct.anon*
// CHECK: [[BC1:%.*]] = bitcast %union.anon.0* [[RES1]] to %struct.anon*
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES2:%[a-z0-9]+]] = getelementptr inbounds %struct.anon, %struct.anon* [[BC1]], i32 0, i32 0
// CHECK: [[LOAD1:%[0-9]+]] = load i8*, i8** [[RES2]],
// CHECK: [[RES2:%.*]] = getelementptr inbounds %struct.anon, %struct.anon* [[BC1]], i32 0, i32 0
// CHECK: [[LOAD1:%.*]] = load i8*, i8** [[RES2]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i8* [[LOAD1]])
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[BC2:%[a-z0-9]+]] = bitcast %union.anon.0* [[RES1]] to %struct.anon.1*
// CHECK: [[BC2:%.*]] = bitcast %union.anon.0* [[RES1]] to %struct.anon.1*
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES3:%[a-z0-9]+]] = getelementptr inbounds %struct.anon.1, %struct.anon.1* [[BC2]], i32 0, i32 0
// CHECK: [[LOAD2:%[0-9]+]] = load i64, i64* [[RES3]],
// CHECK: [[RES3:%.*]] = getelementptr inbounds %struct.anon.1, %struct.anon.1* [[BC2]], i32 0, i32 0
// CHECK: [[LOAD2:%.*]] = load i64, i64* [[RES3]],
// CHECK: call i32 (i8*, ...) @printf({{.*}}, i64 [[LOAD2]])
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: call i32 (i8*, ...) @printf(
@ -528,11 +528,11 @@ void test5(void) {
};
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* {{.*}}, i32 0, i32 0))
// CHECK: [[BC1:%[0-9a-z.]+]] = bitcast %struct.T5A* %a to i8*
// CHECK: [[LOAD1:%[0-9a-z.]+]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%[0-9a-z.]+]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%[0-9a-z.]+]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: [[BC1:%.*]] = bitcast %struct.T5A* %a to i8*
// CHECK: [[LOAD1:%.*]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%.*]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%.*]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: call i32 (i8*, ...) @printf(
__builtin_dump_struct(&a, &printf);
}
@ -551,23 +551,23 @@ void test6(void) {
};
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[BC1:%[0-9a-z.]+]] = bitcast %struct.T6A* %a to i8*
// CHECK: [[LOAD1:%[0-9a-z.]+]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%[0-9a-z.]+]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%[0-9a-z.]+]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: [[BC2:%[0-9a-z.]+]] = bitcast %struct.T6A* %a to i8*
// CHECK: [[LOAD2:%[0-9a-z.]+]] = load i8, i8* [[BC2]], align 4
// CHECK: [[LSHR2:%[0-9a-z.]+]] = lshr i8 [[LOAD2]], 1
// CHECK: [[CLEAR2:%[0-9a-z.]+]] = and i8 [[LSHR2]], 1
// CHECK: [[CAST2:%[0-9a-z.]+]] = zext i8 [[CLEAR2]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST2]])
// CHECK: [[BC3:%[0-9a-z.]+]] = bitcast %struct.T6A* %a to i8*
// CHECK: [[LOAD3:%[0-9a-z.]+]] = load i8, i8* [[BC3]], align 4
// CHECK: [[LSHR3:%[0-9a-z.]+]] = lshr i8 [[LOAD3]], 2
// CHECK: [[CLEAR3:%[0-9a-z.]+]] = and i8 [[LSHR3]], 1
// CHECK: [[CAST3:%[0-9a-z.]+]] = zext i8 [[CLEAR3]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST3]])
// CHECK: [[BC1:%.*]] = bitcast %struct.T6A* %a to i8*
// CHECK: [[LOAD1:%.*]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%.*]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%.*]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: [[BC2:%.*]] = bitcast %struct.T6A* %a to i8*
// CHECK: [[LOAD2:%.*]] = load i8, i8* [[BC2]], align 4
// CHECK: [[LSHR2:%.*]] = lshr i8 [[LOAD2]], 1
// CHECK: [[CLEAR2:%.*]] = and i8 [[LSHR2]], 1
// CHECK: [[CAST2:%.*]] = zext i8 [[CLEAR2]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST2]])
// CHECK: [[BC3:%.*]] = bitcast %struct.T6A* %a to i8*
// CHECK: [[LOAD3:%.*]] = load i8, i8* [[BC3]], align 4
// CHECK: [[LSHR3:%.*]] = lshr i8 [[LOAD3]], 2
// CHECK: [[CLEAR3:%.*]] = and i8 [[LSHR3]], 1
// CHECK: [[CAST3:%.*]] = zext i8 [[CLEAR3]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST3]])
// CHECK: call i32 (i8*, ...) @printf(
__builtin_dump_struct(&a, &printf);
}
@ -589,19 +589,19 @@ void test7(void) {
};
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES1:%[azAZ._0-9]+]] = getelementptr inbounds %struct.T7B, %struct.T7B* %a, i32 0, i32 0
// CHECK: [[RES1:%.*]] = getelementptr inbounds %struct.T7B, %struct.T7B* %a, i32 0, i32 0
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[BC1:%[azAZ._0-9]+]] = bitcast %struct.T7A* [[RES1]] to i8*
// CHECK: [[LOAD1:%[-a-zA-Z._0-9]+]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%[-a-zA-Z._0-9]+]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%[-a-zA-Z._0-9]+]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: [[BC1:%.*]] = bitcast %struct.T7A* [[RES1]] to i8*
// CHECK: [[LOAD1:%.*]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%.*]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%.*]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES2:%[-a-zA-Z._0-9]+]] = getelementptr inbounds %struct.T7B, %struct.T7B* %a, i32 0, i32 1
// CHECK: [[LOAD2:%[-a-zA-Z._0-9]+]] = load i8, i8* [[RES2]], align 4
// CHECK: [[CLEAR2:%[-a-zA-Z._0-9]+]] = and i8 [[LOAD2]], 1
// CHECK: [[CAST2:%[-a-zA-Z._0-9]+]] = zext i8 [[CLEAR2]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST2]])
// CHECK: [[RES2:%.*]] = getelementptr inbounds %struct.T7B, %struct.T7B* %a, i32 0, i32 1
// CHECK: [[LOAD2:%.*]] = load i8, i8* [[RES2]], align 4
// CHECK: [[CLEAR2:%.*]] = and i8 [[LOAD2]], 1
// CHECK: [[CAST2:%.*]] = zext i8 [[CLEAR2]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST2]])
// CHECK: call i32 (i8*, ...) @printf(
__builtin_dump_struct(&a, &printf);
}
@ -619,21 +619,21 @@ void test8(void) {
};
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[BC1:%[azAZ._0-9]+]] = bitcast %struct.T8A* %a to i8*
// CHECK: [[LOAD1:%[-a-zA-Z._0-9]+]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%[-a-zA-Z._0-9]+]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%[-a-zA-Z._0-9]+]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: [[BC2:%[azAZ._0-9]+]] = bitcast %struct.T8A* %a to i8*
// CHECK: [[LOAD2:%[-a-zA-Z._0-9]+]] = load i8, i8* [[BC2]],
// CHECK: [[LSHR2:%[0-9a-z.]+]] = lshr i8 [[LOAD2]], 1
// CHECK: [[CLEAR2:%[-a-zA-Z._0-9]+]] = and i8 [[LSHR2]], 7
// CHECK: [[CAST2:%[-a-zA-Z._0-9]+]] = zext i8 [[CLEAR2]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST2]])
// CHECK: [[BC1:%.*]] = bitcast %struct.T8A* %a to i8*
// CHECK: [[LOAD1:%.*]] = load i8, i8* [[BC1]],
// CHECK: [[CLEAR1:%.*]] = and i8 [[LOAD1]], 1
// CHECK: [[CAST1:%.*]] = zext i8 [[CLEAR1]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST1]])
// CHECK: [[BC2:%.*]] = bitcast %struct.T8A* %a to i8*
// CHECK: [[LOAD2:%.*]] = load i8, i8* [[BC2]],
// CHECK: [[LSHR2:%.*]] = lshr i8 [[LOAD2]], 1
// CHECK: [[CLEAR2:%.*]] = and i8 [[LSHR2]], 7
// CHECK: [[CAST2:%.*]] = zext i8 [[CLEAR2]] to i32
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* {{.*}}, i32 0, i32 0), i32 [[CAST2]])
// CHECK: call i32 (i8*, ...) @printf(
// CHECK: [[RES3:%[-a-zA-Z._0-9]+]] = getelementptr inbounds %struct.T8A, %struct.T8A* %a, i32 0, i32 1
// CHECK: [[LOAD3:%[-a-zA-Z._0-9]+]] = load i32, i32* [[RES3]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* {{.*}}, i32 0, i32 0), i32 [[LOAD3]])
// CHECK: [[RES3:%.*]] = getelementptr inbounds %struct.T8A, %struct.T8A* %a, i32 0, i32 1
// CHECK: [[LOAD3:%.*]] = load i32, i32* [[RES3]],
// CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* {{.*}}, i32 0, i32 0), i32 [[LOAD3]])
// CHECK: call i32 (i8*, ...) @printf(
__builtin_dump_struct(&a, &printf);
}