[PATCH] D24628: [ASAN] Pass previous stack information through __sanitizer_finish_switch_fiber

Andrii Grynenko via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 13:29:52 PDT 2016


andriigrynenko added inline comments.

================
Comment at: test/asan/TestCases/Linux/swapcontext_annotation.cc:176-199
@@ -164,7 +175,26 @@
     ret += Run(argc - 1, 0, stack);
+    // CHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: Main context from: [[CHILD_STACK]] 524288
     ret += Run(argc - 1, 1, stack);
+    // CHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: Main context from: [[CHILD_STACK]] 524288
     ret += Run(argc - 1, 2, stack);
+    // CHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: NextChild stack: [[NEXT_CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: NextChild from: [[CHILD_STACK]] 524288
+    // CHECK: Main context from: [[NEXT_CHILD_STACK]] 524288
     ret += Run(argc - 1, 0, heap);
+    // CHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: Main context from: [[CHILD_STACK]] 524288
     ret += Run(argc - 1, 1, heap);
+    // CHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: Main context from: [[CHILD_STACK]] 524288
     ret += Run(argc - 1, 2, heap);
+    // CHECK: Child stack: [[CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: NextChild stack: [[NEXT_CHILD_STACK:0x[0-9a-f]*]]
+    // CHECK: NextChild from: [[CHILD_STACK]] 524288
+    // CHECK: Main context from: [[NEXT_CHILD_STACK]] 524288
+
+    // CHECK: Iteration 0 passed
+    printf("Iteration %d passed\n", i);
   }
----------------
dvyukov wrote:
> andriigrynenko wrote:
> > This only checks the first iteration of the loop. Can I do it better with FileCheck ? 
> Yes, you can add CHECKs for the second iteration as well.
> 
@dvyukov: What I meant is that I didn't see a way to have some kind of loop in these CHECKs. I don't want to copy-paste these same CHECKs 30 times :)


https://reviews.llvm.org/D24628





More information about the cfe-commits mailing list