[llvm] r340100 - [AST][Tests] Clarify what each test is doing
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Fri Aug 17 14:58:26 PDT 2018
Author: reames
Date: Fri Aug 17 14:58:26 2018
New Revision: 340100
URL: http://llvm.org/viewvc/llvm-project?rev=340100&view=rev
Log:
[AST][Tests] Clarify what each test is doing
Modified:
llvm/trunk/test/Analysis/AliasSet/argmemonly.ll
Modified: llvm/trunk/test/Analysis/AliasSet/argmemonly.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Analysis/AliasSet/argmemonly.ll?rev=340100&r1=340099&r2=340100&view=diff
==============================================================================
--- llvm/trunk/test/Analysis/AliasSet/argmemonly.ll (original)
+++ llvm/trunk/test/Analysis/AliasSet/argmemonly.ll Fri Aug 17 14:58:26 2018
@@ -3,34 +3,39 @@
@s = global i8 1, align 1
@d = global i8 2, align 1
-; CHECK: Alias sets for function 'test1':
-; CHECK-NEXT: Alias Set Tracker: 3 alias sets for 2 pointer values.
+; CHECK: Alias sets for function 'test_alloca_argmemonly':
+; CHECK-NEXT: Alias Set Tracker: 2 alias sets for 1 pointer values.
; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1)
; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 1] may alias, Mod/Ref
; CHECK-NEXT: 1 Unknown instructions: call void @my_memcpy(i8* %d, i8* %s, i64 1)
-; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
-define void @test1(i8* %s, i8* %d) {
+define void @test_alloca_argmemonly(i8* %s, i8* %d) {
entry:
%a = alloca i8, align 1
- %b = alloca i8, align 1
store i8 1, i8* %a, align 1
call void @my_memcpy(i8* %d, i8* %s, i64 1)
- store i8 1, i8* %b, align 1
ret void
}
-; CHECK: Alias sets for function 'test3':
-; CHECK-NEXT: Alias Set Tracker: 3 alias sets for 2 pointer values.
+; CHECK: Alias sets for function 'test_readonly_arg'
+; CHECK-NEXT: Alias Set Tracker: 1 alias sets for 1 pointer values.
+; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 2] may alias, Mod/Ref Pointers: (i8* %s, 1)
+; CHECK-NEXT: 1 Unknown instructions: call void @my_memcpy(i8* %d, i8* %s, i64 1)
+define i8 @test_readonly_arg(i8* noalias %s, i8* noalias %d) {
+entry:
+ call void @my_memcpy(i8* %d, i8* %s, i64 1)
+ %ret = load i8, i8* %s
+ ret i8 %ret
+}
+
+; CHECK: Alias sets for function 'test_noalias_argmemonly':
+; CHECK-NEXT: Alias Set Tracker: 2 alias sets for 1 pointer values.
; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %a, 1)
; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 1] may alias, Mod/Ref
; CHECK-NEXT: Unknown instructions: call void @my_memmove(i8* %d, i8* %s, i64 1)
-
-; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 1] must alias, Mod Pointers: (i8* %b, 1)
-define void @test3(i8* noalias %a, i8* noalias %b, i8* %s, i8* %d) {
+define void @test_noalias_argmemonly(i8* noalias %a, i8* %s, i8* %d) {
entry:
store i8 1, i8* %a, align 1
call void @my_memmove(i8* %d, i8* %s, i64 1)
- store i8 1, i8* %b, align 1
ret void
}
@@ -46,11 +51,11 @@ entry:
ret void
}
-; CHECK: Alias sets for function 'test6':
+; CHECK: Alias sets for function 'test_argcollapse':
; CHECK-NEXT: Alias Set Tracker: 1 alias sets for 2 pointer values.
; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 3] may alias, Mod/Ref Pointers: (i8* %a, 1), (i8* %b, 1)
; CHECK-NEXT: 1 Unknown instructions: call void @my_memmove(i8* %b, i8* %a, i64 1)
-define void @test6(i8* noalias %a, i8* noalias %b) {
+define void @test_argcollapse(i8* noalias %a, i8* noalias %b) {
entry:
store i8 1, i8* %a, align 1
call void @my_memmove(i8* %b, i8* %a, i64 1)
@@ -58,17 +63,15 @@ entry:
ret void
}
-; CHECK: Alias sets for function 'test7':
-; CHECK-NEXT: Alias Set Tracker: 1 alias sets for 2 pointer values.
-; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 3] may alias, Mod/Ref Pointers: (i8* %a, 1), (i8* %b, 1)
+; CHECK: Alias sets for function 'test_memcpy1':
+; CHECK-NEXT: Alias Set Tracker: 1 alias sets for 0 pointer values.
+; CHECK-NEXT: AliasSet[0x{{[0-9a-f]+}}, 1] may alias, Mod/Ref
; CHECK-NEXT: 2 Unknown instructions: call void @my_memcpy(i8* %b, i8* %a, i64 1), call void @my_memcpy(i8* %a, i8* %b, i64 1)
-define void @test7(i8* noalias %a, i8* noalias %b) {
+define void @test_memcpy1(i8* noalias %a, i8* noalias %b) {
entry:
- store i8 1, i8* %a, align 1
call void @my_memcpy(i8* %b, i8* %a, i64 1)
call void @my_memcpy(i8* %a, i8* %b, i64 1)
- store i8 1, i8* %b, align 1
ret void
}
More information about the llvm-commits
mailing list