@@ -58,3 +58,51 @@ define void @test5(i64 %Q_as_int) {
58
58
store i8 1 , ptr %Q
59
59
ret void
60
60
}
61
+
62
+ ; Verify that extractvalue of a coerced ptr argument array are NoAlias a function local object
63
+ define void @test_extractvalue ([2 x ptr ] %Q.coerce ) {
64
+ ; CHECK-LABEL: Function: test_extractvalue:
65
+ ; CHECK: NoAlias: i8* %P, i8* %Q
66
+ %P = alloca i8
67
+ %Q = extractvalue [2 x ptr ] %Q.coerce , 1
68
+ store i8 0 , ptr %P
69
+ store i8 1 , ptr %Q
70
+ ret void
71
+ }
72
+
73
+ ; Same as test_extractvalue with an escape of %P
74
+ define void @test_extractvalue_escape ([2 x ptr ] %Q.coerce ) {
75
+ ; CHECK-LABEL: Function: test_extractvalue_escape:
76
+ ; CHECK: MayAlias: i8* %P, i8* %Q
77
+ %P = alloca i8
78
+ call void @escape (ptr %P )
79
+ %Q = extractvalue [2 x ptr ] %Q.coerce , 1
80
+ store i8 0 , ptr %P
81
+ store i8 1 , ptr %Q
82
+ ret void
83
+ }
84
+
85
+ ; Verify that extractvalue of a coerced ptr argument array are NoAlias a function local object
86
+ define void @test_extractvalue_int ([2 x i64 ] %Q.coerce ) {
87
+ ; CHECK-LABEL: Function: test_extractvalue_int:
88
+ ; CHECK: NoAlias: i8* %P, i8* %Q
89
+ %P = alloca i8
90
+ %Q_as_int = extractvalue [2 x i64 ] %Q.coerce , 1
91
+ %Q = inttoptr i64 %Q_as_int to ptr
92
+ store i8 0 , ptr %P
93
+ store i8 1 , ptr %Q
94
+ ret void
95
+ }
96
+
97
+ ; Same as test_extractvalue_int with an escape of %P
98
+ define void @test_extractvalue_int_escape ([2 x i64 ] %Q.coerce ) {
99
+ ; CHECK-LABEL: Function: test_extractvalue_int_escape:
100
+ ; CHECK: MayAlias: i8* %P, i8* %Q
101
+ %P = alloca i8
102
+ call void @escape (ptr %P )
103
+ %Q_as_int = extractvalue [2 x i64 ] %Q.coerce , 1
104
+ %Q = inttoptr i64 %Q_as_int to ptr
105
+ store i8 0 , ptr %P
106
+ store i8 1 , ptr %Q
107
+ ret void
108
+ }
0 commit comments