@@ -21,6 +21,36 @@ long test_InterlockedAdd_constant(long volatile *Addend) {
21
21
// CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
22
22
// CHECK-LINUX: error: call to undeclared function '_InterlockedAdd'
23
23
24
+ long test_InterlockedAdd_acq (long volatile * Addend , long Value ) {
25
+ return _InterlockedAdd_acq (Addend , Value );
26
+ }
27
+
28
+ // CHECK-LABEL: define {{.*}} i32 @test_InterlockedAdd_acq(ptr %Addend, i32 %Value) {{.*}} {
29
+ // CHECK-MSVC: %[[OLDVAL:[0-9]+]] = atomicrmw add ptr %1, i32 %2 acquire, align 4
30
+ // CHECK-MSVC: %[[NEWVAL:[0-9]+]] = add i32 %[[OLDVAL:[0-9]+]], %2
31
+ // CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
32
+ // CHECK-LINUX: error: call to undeclared function '_InterlockedAdd_acq'
33
+
34
+ long test_InterlockedAdd_nf (long volatile * Addend , long Value ) {
35
+ return _InterlockedAdd_nf (Addend , Value );
36
+ }
37
+
38
+ // CHECK-LABEL: define {{.*}} i32 @test_InterlockedAdd_nf(ptr %Addend, i32 %Value) {{.*}} {
39
+ // CHECK-MSVC: %[[OLDVAL:[0-9]+]] = atomicrmw add ptr %1, i32 %2 monotonic, align 4
40
+ // CHECK-MSVC: %[[NEWVAL:[0-9]+]] = add i32 %[[OLDVAL:[0-9]+]], %2
41
+ // CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
42
+ // CHECK-LINUX: error: call to undeclared function '_InterlockedAdd_nf'
43
+
44
+ long test_InterlockedAdd_rel (long volatile * Addend , long Value ) {
45
+ return _InterlockedAdd_rel (Addend , Value );
46
+ }
47
+
48
+ // CHECK-LABEL: define {{.*}} i32 @test_InterlockedAdd_rel(ptr %Addend, i32 %Value) {{.*}} {
49
+ // CHECK-MSVC: %[[OLDVAL:[0-9]+]] = atomicrmw add ptr %1, i32 %2 release, align 4
50
+ // CHECK-MSVC: %[[NEWVAL:[0-9]+]] = add i32 %[[OLDVAL:[0-9]+]], %2
51
+ // CHECK-MSVC: ret i32 %[[NEWVAL:[0-9]+]]
52
+ // CHECK-LINUX: error: call to undeclared function '_InterlockedAdd_rel'
53
+
24
54
__int64 test_InterlockedAdd64 (__int64 volatile * Addend , __int64 Value ) {
25
55
return _InterlockedAdd64 (Addend , Value );
26
56
}
@@ -35,6 +65,36 @@ __int64 test_InterlockedAdd64_constant(__int64 volatile *Addend) {
35
65
// CHECK-MSVC: ret i64 %[[NEWVAL:[0-9]+]]
36
66
// CHECK-LINUX: error: call to undeclared function '_InterlockedAdd64'
37
67
68
+ __int64 test_InterlockedAdd64_acq (__int64 volatile * Addend , __int64 Value ) {
69
+ return _InterlockedAdd64_acq (Addend , Value );
70
+ }
71
+
72
+ // CHECK-LABEL: define {{.*}} i64 @test_InterlockedAdd64_acq(ptr %Addend, i64 %Value) {{.*}} {
73
+ // CHECK-MSVC: %[[OLDVAL:[0-9]+]] = atomicrmw add ptr %1, i64 %2 acquire, align 8
74
+ // CHECK-MSVC: %[[NEWVAL:[0-9]+]] = add i64 %[[OLDVAL:[0-9]+]], %2
75
+ // CHECK-MSVC: ret i64 %[[NEWVAL:[0-9]+]]
76
+ // CHECK-LINUX: error: call to undeclared function '_InterlockedAdd64_acq'
77
+
78
+ __int64 test_InterlockedAdd64_nf (__int64 volatile * Addend , __int64 Value ) {
79
+ return _InterlockedAdd64_nf (Addend , Value );
80
+ }
81
+
82
+ // CHECK-LABEL: define {{.*}} i64 @test_InterlockedAdd64_nf(ptr %Addend, i64 %Value) {{.*}} {
83
+ // CHECK-MSVC: %[[OLDVAL:[0-9]+]] = atomicrmw add ptr %1, i64 %2 monotonic, align 8
84
+ // CHECK-MSVC: %[[NEWVAL:[0-9]+]] = add i64 %[[OLDVAL:[0-9]+]], %2
85
+ // CHECK-MSVC: ret i64 %[[NEWVAL:[0-9]+]]
86
+ // CHECK-LINUX: error: call to undeclared function '_InterlockedAdd64_nf'
87
+
88
+ __int64 test_InterlockedAdd64_rel (__int64 volatile * Addend , __int64 Value ) {
89
+ return _InterlockedAdd64_rel (Addend , Value );
90
+ }
91
+
92
+ // CHECK-LABEL: define {{.*}} i64 @test_InterlockedAdd64_rel(ptr %Addend, i64 %Value) {{.*}} {
93
+ // CHECK-MSVC: %[[OLDVAL:[0-9]+]] = atomicrmw add ptr %1, i64 %2 release, align 8
94
+ // CHECK-MSVC: %[[NEWVAL:[0-9]+]] = add i64 %[[OLDVAL:[0-9]+]], %2
95
+ // CHECK-MSVC: ret i64 %[[NEWVAL:[0-9]+]]
96
+ // CHECK-LINUX: error: call to undeclared function '_InterlockedAdd64_rel'
97
+
38
98
void check_ReadWriteBarrier (void ) {
39
99
_ReadWriteBarrier ();
40
100
}
0 commit comments