3
3
4
4
// .
5
5
// CHECK: @x = global %struct.CompleteS zeroinitializer, align 8
6
+ // CHECK: @xExtern = external global %struct.CompleteS, align 8
6
7
// CHECK: @y = external global %struct.S, align 1
8
+ // CHECK: @d = global %class.b zeroinitializer, align 1
9
+ // CHECK: @_ZN1b1eE = external global %class.a, align 1
7
10
// CHECK: @__tysan_shadow_memory_address = external global i64
8
11
// CHECK: @__tysan_app_memory_mask = external global i64
9
12
// CHECK: @__tysan_v1_Simple_20C_2b_2b_20TBAA = linkonce_odr constant { i64, i64, [16 x i8] } { i64 2, i64 0, [16 x i8] c"Simple C++ TBAA\00" }, comdat
12
15
// CHECK: @__tysan_v1_any_20pointer = linkonce_odr constant { i64, i64, ptr, i64, [12 x i8] } { i64 2, i64 1, ptr @__tysan_v1_omnipotent_20char, i64 0, [12 x i8] c"any pointer\00" }, comdat
13
16
// CHECK: @__tysan_v1_p1_20int = linkonce_odr constant { i64, i64, ptr, i64, [7 x i8] } { i64 2, i64 1, ptr @__tysan_v1_any_20pointer, i64 0, [7 x i8] c"p1 int\00" }, comdat
14
17
// CHECK: @__tysan_v1___ZTS9CompleteS = linkonce_odr constant { i64, i64, ptr, i64, ptr, i64, [15 x i8] } { i64 2, i64 2, ptr @__tysan_v1_int, i64 0, ptr @__tysan_v1_p1_20int, i64 8, [15 x i8] c"_ZTS9CompleteS\00" }, comdat
15
- // CHECK: @llvm.used = appending global [7 x ptr] [ptr @tysan.module_ctor, ptr @__tysan_v1_Simple_20C_2b_2b_20TBAA, ptr @__tysan_v1_omnipotent_20char, ptr @__tysan_v1_int, ptr @__tysan_v1_any_20pointer, ptr @__tysan_v1_p1_20int, ptr @__tysan_v1___ZTS9CompleteS], section "llvm.metadata"
16
- // CHECK: @llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 0, ptr @tysan.module_ctor, ptr null }]
18
+ // CHECK: @__tysan_v1___ZTS1b = linkonce_odr constant { i64, i64, [7 x i8] } { i64 2, i64 0, [7 x i8] c"_ZTS1b\00" }, comdat
19
+ // CHECK: @llvm.used = appending global [8 x ptr] [ptr @tysan.module_ctor, ptr @__tysan_v1_Simple_20C_2b_2b_20TBAA, ptr @__tysan_v1_omnipotent_20char, ptr @__tysan_v1_int, ptr @__tysan_v1_any_20pointer, ptr @__tysan_v1_p1_20int, ptr @__tysan_v1___ZTS9CompleteS, ptr @__tysan_v1___ZTS1b], section "llvm.metadata"
20
+ // CHECK: @llvm.global_ctors = appending global [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @_GLOBAL__sub_I_sanitize_type_globals.cpp, ptr null }, { i32, ptr, ptr } { i32 0, ptr @tysan.module_ctor, ptr null }]
17
21
// .
18
22
struct CompleteS {
19
23
int x;
@@ -22,13 +26,18 @@ struct CompleteS {
22
26
23
27
void f (CompleteS *);
24
28
CompleteS x;
29
+ extern CompleteS xExtern;
25
30
// CHECK-LABEL: define dso_local void @_Z1gv(
26
31
// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
27
32
// CHECK: [[ENTRY:.*:]]
28
33
// CHECK: call void @_Z1fP9CompleteS(ptr noundef @x)
34
+ // CHECK: call void @_Z1fP9CompleteS(ptr noundef @xExtern)
29
35
// CHECK: ret void
30
36
//
31
- void g () { f (&x); }
37
+ void g () {
38
+ f (&x);
39
+ f (&xExtern);
40
+ }
32
41
33
42
typedef struct S IncompleteS;
34
43
void f (IncompleteS *);
@@ -40,11 +49,21 @@ extern IncompleteS y;
40
49
// CHECK: ret void
41
50
//
42
51
void h () { f (&y); }
52
+
53
+ class a ;
54
+ class b {
55
+ public:
56
+ using c = a;
57
+ static c e;
58
+ b (int , c & = e);
59
+ } d = 0 ;
60
+
43
61
// .
44
62
// CHECK: attributes #[[ATTR0]] = { mustprogress noinline nounwind optnone sanitize_type "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
45
63
// CHECK: attributes #[[ATTR1:[0-9]+]] = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
46
- // CHECK: attributes #[[ATTR2:[0-9]+]] = { nounwind "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
47
- // CHECK: attributes #[[ATTR3:[0-9]+]] = { nounwind }
64
+ // CHECK: attributes #[[ATTR2:[0-9]+]] = { noinline nounwind sanitize_type "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
65
+ // CHECK: attributes #[[ATTR3:[0-9]+]] = { nounwind "target-features"="+cx8,+mmx,+sse,+sse2,+x87" }
66
+ // CHECK: attributes #[[ATTR4:[0-9]+]] = { nounwind }
48
67
// .
49
68
// CHECK: [[META0:![0-9]+]] = !{ptr @x, [[META1:![0-9]+]]}
50
69
// CHECK: [[META1]] = !{!"_ZTS9CompleteS", [[META2:![0-9]+]], i64 0, [[META5:![0-9]+]], i64 8}
@@ -53,6 +72,8 @@ void h() { f(&y); }
53
72
// CHECK: [[META4]] = !{!"Simple C++ TBAA"}
54
73
// CHECK: [[META5]] = !{!"p1 int", [[META6:![0-9]+]], i64 0}
55
74
// CHECK: [[META6]] = !{!"any pointer", [[META3]], i64 0}
56
- // CHECK: [[META7:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
57
- // CHECK: [[META8:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
75
+ // CHECK: [[META7:![0-9]+]] = !{ptr @d, [[META8:![0-9]+]]}
76
+ // CHECK: [[META8]] = !{!"_ZTS1b"}
77
+ // CHECK: [[META9:![0-9]+]] = !{i32 1, !"wchar_size", i32 4}
78
+ // CHECK: [[META10:![0-9]+]] = !{!"{{.*}}clang version {{.*}}"}
58
79
// .
0 commit comments