mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 00:26:43 +00:00

This patch makes a further attempt to fix the tests broken by the previous revision by ensuring that the command line for the modified Dexter tests use -std=gnu++11, in keeping with the old build script. This reverts commit 5647f2908de90fe07b0805e988cd2e91a1751928.
35 lines
840 B
C
35 lines
840 B
C
// REQUIRES: lldb
|
|
// UNSUPPORTED: system-windows
|
|
// RUN: %clang -std=gnu11 -O2 -glldb %s -o %t
|
|
// RUN: %dexter --fail-lt 1.0 -w --debugger lldb --binary %t -- %s
|
|
|
|
//// Check that we give good locations to a variable ('local') which is escaped
|
|
//// down some control paths and not others. This example is handled well currently.
|
|
|
|
int g;
|
|
__attribute__((__noinline__))
|
|
void leak(int *ptr) {
|
|
g = *ptr;
|
|
*ptr = 2;
|
|
}
|
|
|
|
__attribute__((__noinline__))
|
|
int fun(int cond) {
|
|
int local = 0; // DexLabel('s1')
|
|
if (cond)
|
|
leak(&local);
|
|
else
|
|
local = 1;
|
|
return local; // DexLabel('s2')
|
|
}
|
|
|
|
int main() {
|
|
int a = fun(1);
|
|
int b = fun(0);
|
|
return a + b;
|
|
}
|
|
|
|
//// fun(1) fun(0)
|
|
// DexExpectWatchValue('local', '0', '0', on_line=ref('s1'))
|
|
// DexExpectWatchValue('local', '2', '1', on_line=ref('s2'))
|