================
@@ -87,7 +105,13 @@ int foo(unsigned n) {
// ZERO-MAX-1024: store i64 0, ptr %var_size_8_init_later, align 8,
!annotation [[AUTO_INIT:!.+]]
// ZERO-MAX-1024: store ptr null, ptr %var_size_8p, align 8, !annotation
[[AUTO_INIT:!.+]]
// ZERO-MAX-1024: call void @llvm.memset.p0.i64(ptr align 16 %var_size_1024,
i8 0, i64 1024, i1 false), !annotation [[AUTO_INIT:!.+]]
- // ZERO-MAX-1024-NOT: call void @llvm.memset.p0.i64(ptr align 4
%var_size_1032, i8 0, i64 1032, i1 false), !annotation [[AUTO_INIT:!.+]]
+ // ZERO-MAX-1024: %f = getelementptr inbounds nuw %struct.Bar, ptr
%var_size_1032, i32 0, i32 0
+ // ZERO-MAX-1024: %x = getelementptr inbounds nuw %struct.Foo, ptr %f, i32
0, i32 0
+ // ZERO-MAX-1024: store i32 0, ptr %x, align 4, !annotation !1
+ // ZERO-MAX-1024: %buff = getelementptr inbounds nuw %struct.Foo, ptr %f,
i32 0, i32 1
+ // ZERO-MAX-1024: call void @llvm.memset.p0.i64(ptr align 4 %buff, i8 0, i64
1024, i1 false), !annotation !1
+ // ZERO-MAX-1024: %y = getelementptr inbounds nuw %struct.Bar, ptr
%var_size_1032, i32 0, i32 1
+ // ZERO-MAX-1024: store i32 0, ptr %y, align 4, !annotation !1
// ZERO-MAX-1024-NOT: call void @llvm.memset.p0.i64(ptr align 16
%var_size_4096, i8 0, i64 4096, i1 false), !annotation [[AUTO_INIT:!.+]]
// ZERO-MAX-4096: store i8 0, ptr %var_size_1, align 1, !annotation
[[AUTO_INIT:!.+]]
----------------
vitalybuka wrote:
This will crash:
```
struct Empty {};
struct Base {
int base_field;
};
struct PartialStruct : Base {
float a;
[[no_unique_address]] Empty e;
unsigned bf_small : 3;
bool bf_bool : 1;
unsigned _BitInt(192) bf_bitint : 3;
char large_buf[2048];
int b;
};
void use(void *);
void test_partial() {
PartialStruct s;
use(&s);
}
```
https://github.com/llvm/llvm-project/pull/229584
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits