llvm-project/clang/test/CodeGen/variadic-gpfp-x86.c
Hari Limaye 94473f4db6
[IRBuilder] Generate nuw GEPs for struct member accesses (#99538)
Generate nuw GEPs for struct member accesses, as inbounds + non-negative
implies nuw.

Regression tests are updated using update scripts where possible, and by
find + replace where not.
2024-08-09 13:25:04 +01:00

15 lines
438 B
C

// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o - | FileCheck %s
struct Bar {
float f1;
float f2;
unsigned u;
};
struct Bar foo(__builtin_va_list ap) {
return __builtin_va_arg(ap, struct Bar);
// CHECK: [[FPOP:%.*]] = getelementptr inbounds nuw %struct.__va_list_tag, ptr {{.*}}, i32 0, i32 1
// CHECK: [[FPO:%.*]] = load i32, ptr [[FPOP]]
// CHECK: [[FPVEC:%.*]] = getelementptr i8, ptr {{.*}}, i32 [[FPO]]
}