[clang] 1583158 - [BPF] fix clang test failure for bpf-attr-preserve-access-index-4.c

Yonghong Song via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 13 09:43:46 PST 2019


Author: Yonghong Song
Date: 2019-11-13T09:40:57-08:00
New Revision: 1583158042a7e1f8b4f5194b1db362328e6902f3

URL: https://github.com/llvm/llvm-project/commit/1583158042a7e1f8b4f5194b1db362328e6902f3
DIFF: https://github.com/llvm/llvm-project/commit/1583158042a7e1f8b4f5194b1db362328e6902f3.diff

LOG: [BPF] fix clang test failure for bpf-attr-preserve-access-index-4.c

Depending on different cmake configures, clang may generate different
IR name for slot variables. Let us use the regex instead of hard
coding the name. I did the same for other bpf-attr-preserve-access-index
tests with such an approach, but somehow did not do for this one.

Added: 
    

Modified: 
    clang/test/CodeGen/bpf-attr-preserve-access-index-4.c

Removed: 
    


################################################################################
diff  --git a/clang/test/CodeGen/bpf-attr-preserve-access-index-4.c b/clang/test/CodeGen/bpf-attr-preserve-access-index-4.c
index 5ec56d96de18..49930996e306 100644
--- a/clang/test/CodeGen/bpf-attr-preserve-access-index-4.c
+++ b/clang/test/CodeGen/bpf-attr-preserve-access-index-4.c
@@ -27,7 +27,7 @@ int test(__s3 *arg) {
 
 // CHECK: define dso_local i32 @test
 // CHECK-NOT: call %struct.s2* @llvm.preserve.struct.access.index.p0s_struct.s2s.p0s_struct.s3s
-// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s(%struct.s2* %a, i32 0, i32 0)
-// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %1, i32 0)
-// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %b, i32 1, i32 2)
+// CHECK: call %union.anon* @llvm.preserve.struct.access.index.p0s_union.anons.p0s_struct.s2s(%struct.s2* %{{[0-9a-z]+}}, i32 0, i32 0)
+// CHECK: call %union.anon* @llvm.preserve.union.access.index.p0s_union.anons.p0s_union.anons(%union.anon* %{{[0-9a-z]+}}, i32 0)
+// CHECK: call %struct.s1* @llvm.preserve.array.access.index.p0s_struct.s1s.p0a3s_struct.s1s([3 x %struct.s1]* %{{[0-9a-z]+}}, i32 1, i32 2)
 // CHECK-NOT: call i32* @llvm.preserve.struct.access.index.p0i32.p0s_struct.s1s


        


More information about the cfe-commits mailing list