Skip to content

Commit

Permalink
Fix conflict resoultion in annotations-field.c
Browse files Browse the repository at this point in the history
  • Loading branch information
jsji committed Sep 6, 2024
1 parent 31c30b1 commit c7291e6
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions clang/test/CodeGen/annotations-field.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,14 @@ int main(int argc, char **argv) {
struct foo f;
f.v = argc;
// CHECK: getelementptr inbounds nuw %struct.foo, ptr %{{.*}}, i32 0, i32 0
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 9, ptr[[$CONST_AS]] null)
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 9, ptr[[$CONST_AS]] null)

// CHECK: getelementptr inbounds %struct.foo, ptr %{{.*}}, i32 0, i32 0
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 13, ptr[[$CONST_AS]] null)
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 13, ptr[[$CONST_AS]] null)
f.w = 42;
// CHECK: getelementptr inbounds %struct.foo, ptr %{{.*}}, i32 0, i32 1
// CHECK: getelementptr inbounds nuw %struct.foo, ptr %{{.*}}, i32 0, i32 1
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 14, ptr[[$CONST_AS]] null)
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 14, ptr[[$CONST_AS]] null)
f.f = 0;
// CHECK: getelementptr inbounds %struct.foo, ptr %{{.*}}, i32 0, i32 2
// CHECK: getelementptr inbounds nuw %struct.foo, ptr %{{.*}}, i32 0, i32 2
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 15, ptr[[$CONST_AS]] null)
// CHECK-NEXT: call ptr @llvm.ptr.annotation.p0.[[$MANGLE_AS]]({{.*}}str{{.*}}str{{.*}}i32 15, ptr[[$CONST_AS]] null)

Expand All @@ -42,10 +38,10 @@ int main(int argc, char **argv) {
// AMDGPU: call ptr @llvm.ptr.annotation.p0.p4(ptr addrspacecast (ptr addrspace(1) @gf to ptr), ptr addrspace(4) @.str{{.*}}, ptr addrspace(4) @.str{{.*}}, i32 13, ptr addrspace(4) null)
// AMDGPU-NEXT: call ptr @llvm.ptr.annotation.p0.p4(ptr %{{.*}}, ptr addrspace(4) @.str{{.*}}, ptr addrspace(4) @.str{{.*}}, i32 13, ptr addrspace(4) null)
gf.w = 42;
// X86: call ptr @llvm.ptr.annotation.p0.p0(ptr getelementptr inbounds (%struct.foo, ptr @gf, i32 0, i32 1), {{.*}}str{{.*}}str{{.*}}i32 14, ptr null)
// AMDGPU: call ptr @llvm.ptr.annotation.p0.p4(ptr getelementptr inbounds (%struct.foo, ptr addrspacecast (ptr addrspace(1) @gf to ptr), i32 0, i32 1), {{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(4) null)
// X86: call ptr @llvm.ptr.annotation.p0.p0(ptr getelementptr inbounds nuw (%struct.foo, ptr @gf, i32 0, i32 1), {{.*}}str{{.*}}str{{.*}}i32 14, ptr null)
// AMDGPU: call ptr @llvm.ptr.annotation.p0.p4(ptr getelementptr inbounds nuw (%struct.foo, ptr addrspacecast (ptr addrspace(1) @gf to ptr), i32 0, i32 1), {{.*}}str{{.*}}str{{.*}}i32 14, ptr addrspace(4) null)
gf.f = 0;
// X86: call ptr @llvm.ptr.annotation.p0.p0(ptr getelementptr inbounds (%struct.foo, ptr @gf, i32 0, i32 2), {{.*}}str{{.*}}str{{.*}}i32 15, ptr null)
// AMDGPU: call ptr @llvm.ptr.annotation.p0.p4(ptr getelementptr inbounds (%struct.foo, ptr addrspacecast (ptr addrspace(1) @gf to ptr), i32 0, i32 2), {{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(4) null)
// X86: call ptr @llvm.ptr.annotation.p0.p0(ptr getelementptr inbounds nuw (%struct.foo, ptr @gf, i32 0, i32 2), {{.*}}str{{.*}}str{{.*}}i32 15, ptr null)
// AMDGPU: call ptr @llvm.ptr.annotation.p0.p4(ptr getelementptr inbounds nuw (%struct.foo, ptr addrspacecast (ptr addrspace(1) @gf to ptr), i32 0, i32 2), {{.*}}str{{.*}}str{{.*}}i32 15, ptr addrspace(4) null)
return 0;
}

0 comments on commit c7291e6

Please sign in to comment.