You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/test/Sema/attr-nonblocking-constraints.cpp
+19Lines changed: 19 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -104,6 +104,25 @@ void nb8c()
104
104
};
105
105
}
106
106
107
+
voidnb8d() [[clang::nonblocking]]
108
+
{
109
+
// Blocking methods of a local CXXRecordDecl do not generate diagnostics
110
+
// for the outer function.
111
+
structF1 {
112
+
voidmethod() { void* ptr = newint; }
113
+
};
114
+
115
+
// Skipping the CXXRecordDecl does not skip a following VarDecl.
116
+
structF2 {
117
+
F2() { void* ptr = newint; } // expected-note {{constructor cannot be inferred 'nonblocking' because it allocates or deallocates memory}}
118
+
} f2; // expected-warning {{function with 'nonblocking' attribute must not call non-'nonblocking' constructor 'nb8d()::F2::F2'}}
119
+
120
+
// Nonblocking methods of a local CXXRecordDecl are verified independently.
121
+
structF3 {
122
+
voidmethod() [[clang::nonblocking]] { void* ptr = newint; }// expected-warning {{function with 'nonblocking' attribute must not allocate or deallocate memory}}
123
+
};
124
+
}
125
+
107
126
// Make sure template expansions are found and verified.
v2f16 = __builtin_amdgcn_raw_ptr_buffer_atomic_fadd_v2f16(v2f16, rsrc, offset, soffset, 0, 4); // expected-error{{too many arguments to function call}}
18
+
}
19
+
20
+
__device__ voidtest_raw_ptr_atomics_f16_retty(__amdgpu_buffer_rsrc_t rsrc, inti32, floatf32, float16x2_t v2f16, int offset, int soffset) {
0 commit comments