Index: test/asan/TestCases/use-after-scope-goto.c =================================================================== --- test/asan/TestCases/use-after-scope-goto.c +++ test/asan/TestCases/use-after-scope-goto.c @@ -5,7 +5,7 @@ int *ptr; -void f(int cond) { +void f1(int cond) { if (cond) goto label; int tmp = 1; @@ -15,7 +15,24 @@ *ptr = 5; } +void f2(int cond) { + switch (cond) { + case 1: { + ++cond; + int tmp = 1; + ptr = &tmp; + exit(0); + case 2: + ptr = &tmp; + *ptr = 5; + exit(0); + } + } +} + int main() { - f(1); + f1(1); + f2(2); return 0; } +