diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/OpenMP/atomic_codegen.cpp | 4 | ||||
-rw-r--r-- | clang/test/OpenMP/atomic_messages.cpp | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/clang/test/OpenMP/atomic_codegen.cpp b/clang/test/OpenMP/atomic_codegen.cpp index 2ce1f9450b3..bcaa0e9576c 100644 --- a/clang/test/OpenMP/atomic_codegen.cpp +++ b/clang/test/OpenMP/atomic_codegen.cpp @@ -6,6 +6,7 @@ int a; int b; struct St { + unsigned long field; St() {} ~St() {} int &get() { return a; } @@ -13,6 +14,7 @@ struct St { // CHECK-LABEL: parallel_atomic_ewc void parallel_atomic_ewc() { + St s; #pragma omp parallel { // CHECK: invoke void @_ZN2StC1Ev(%struct.St* [[TEMP_ST_ADDR:%.+]]) @@ -47,6 +49,8 @@ void parallel_atomic_ewc() { // CHECK: invoke void @_ZN2StD1Ev(%struct.St* [[TEMP_ST_ADDR]]) #pragma omp atomic St().get() %= b; +#pragma omp atomic + s.field++; // CHECK: invoke void @_ZN2StC1Ev(%struct.St* [[TEMP_ST_ADDR:%.+]]) // CHECK: [[SCALAR_ADDR:%.+]] = invoke dereferenceable(4) i32* @_ZN2St3getEv(%struct.St* [[TEMP_ST_ADDR]]) // CHECK: [[B_VAL:%.+]] = load i32, i32* @b diff --git a/clang/test/OpenMP/atomic_messages.cpp b/clang/test/OpenMP/atomic_messages.cpp index c3e02bc96e8..7f78ad443da 100644 --- a/clang/test/OpenMP/atomic_messages.cpp +++ b/clang/test/OpenMP/atomic_messages.cpp @@ -48,8 +48,8 @@ T read() { // expected-note@+1 {{expected built-in assignment operator}} foo(); #pragma omp atomic read - // expected-error@+2 {{the statement for 'atomic read' must be an expression statement of form 'v = x;', where v and x are both lvalue expressions with scalar type}} - // expected-note@+1 {{expected built-in assignment operator}} + // expected-error@+2 2 {{the statement for 'atomic read' must be an expression statement of form 'v = x;', where v and x are both lvalue expressions with scalar type}} + // expected-note@+1 2 {{expected built-in assignment operator}} a += b; #pragma omp atomic read // expected-error@+2 {{the statement for 'atomic read' must be an expression statement of form 'v = x;', where v and x are both lvalue expressions with scalar type}} @@ -93,7 +93,8 @@ int read() { #pragma omp atomic read read a = b; - // expected-note@+1 {{in instantiation of function template specialization 'read<S>' requested here}} + // expected-note@+2 {{in instantiation of function template specialization 'read<S>' requested here}} + // expected-note@+1 {{in instantiation of function template specialization 'read<int>' requested here}} return read<int>() + read<S>().a; } @@ -147,6 +148,7 @@ int write() { #pragma omp atomic write a = foo(); + // expected-note@+1 {{in instantiation of function template specialization 'write<int>' requested here}} return write<int>(); } @@ -672,6 +674,7 @@ int capture() { #pragma omp atomic capture capture b = a /= b; + // expected-note@+1 {{in instantiation of function template specialization 'capture<int>' requested here}} return capture<int>(); } |