================
@@ -435,3 +435,31 @@ int test_multi_param_highlight() {
   // CHECK: return multi_params_annotated(&local_one, &local_two);
   // CHECK-NEXT:                                      ^~~~~~~~~~
 }
+
+int test_multi_local_bound_to_param_highlight() {
+  int j = 4, k = 5;
+  // expected-note@-1 {{'j' initialized here}}
+  // expected-note@-2 {{'k' initialized here}}
+  return multi_params_annotated(&j, &k);
+  // expected-warning@-1 {{address of stack memory associated with local 
variable 'j' returned}}
+  // expected-warning@-2 {{address of stack memory associated with local 
variable 'k' returned}}
+  // expected-warning@-3 {{Returning value bound to 'j' that will go out of 
scope}}
+  // expected-note@-4    {{Value's lifetime bound to the lifetime of 'j' here}}
+  // expected-note@-5    {{Lifetime of 'j' ended here}}
+  // expected-warning@-6 {{Returning value bound to 'k' that will go out of 
scope}}
+  // expected-note@-7    {{Value's lifetime bound to the lifetime of 'k' here}}
+  // expected-note@-8    {{Lifetime of 'k' ended here}}
+  
+  // CHECK: note: Value's lifetime bound to the lifetime of 'j' here
+  // CHECK-NEXT: int j = 4, k = 5;
+  // CHECK-NEXT:     ~
+  // CHECK: note: Lifetime of 'j' ended here
+  // CHECK-NEXT: int j = 4, k = 5;
+  // CHECK-NEXT:     ~
----------------
benedekaibas wrote:

I agree that the change in 
[40660e2](https://github.com/llvm/llvm-project/pull/215905/commits/40660e25ed980beaded53f99b654b50d7d212bec)
 saves time on writing the tests, but also 1) not good for visibility 2) can be 
confusing on where the indentations actually opposed to point.

https://github.com/llvm/llvm-project/pull/215905
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to