1
Fork 0

Emit getelementptr inbounds nuw for pointer::add()

This commit is contained in:
Nikita Popov 2025-02-19 11:06:11 +01:00
parent 5e9d8a7d55
commit 31cc4c074d
7 changed files with 55 additions and 15 deletions

View file

@ -6,7 +6,7 @@
// CHECK-SAME: [[WORD:i[0-9]+]] noundef %n)
#[no_mangle]
pub unsafe fn i32_add(p: *const i32, n: usize) -> *const i32 {
// CHECK: %[[TEMP:.+]] = getelementptr inbounds i32, ptr %p, [[WORD]] %n
// CHECK: %[[TEMP:.+]] = getelementptr inbounds{{( nuw)?}} i32, ptr %p, [[WORD]] %n
// CHECK: ret ptr %[[TEMP]]
p.add(n)
}