mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 01:06:06 +00:00

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.
18 lines
568 B
C
18 lines
568 B
C
// RUN: %clang_cc1 -fblocks -triple x86_64-apple-darwin10 -emit-llvm -o - %s | FileCheck %s
|
|
// CHECK: [[Vi:%.+]] = alloca %struct.__block_byref_i, align 8
|
|
// CHECK: call i32 @rhs()
|
|
// CHECK: [[V7:%.+]] = getelementptr inbounds nuw %struct.__block_byref_i, ptr [[Vi]], i32 0, i32 1
|
|
// CHECK: load ptr, ptr [[V7]]
|
|
// CHECK: call i32 @rhs()
|
|
// CHECK: [[V11:%.+]] = getelementptr inbounds nuw %struct.__block_byref_i, ptr [[Vi]], i32 0, i32 1
|
|
// CHECK: load ptr, ptr [[V11]]
|
|
|
|
int rhs(void);
|
|
|
|
void foo(void) {
|
|
__block int i;
|
|
^{ (void)i; };
|
|
i = rhs();
|
|
i += rhs();
|
|
}
|