diff options
Diffstat (limited to 'test/Analysis/asm.cpp')
-rw-r--r-- | test/Analysis/asm.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Analysis/asm.cpp b/test/Analysis/asm.cpp new file mode 100644 index 0000000000000..1180063502168 --- /dev/null +++ b/test/Analysis/asm.cpp @@ -0,0 +1,12 @@ +// RUN: %clang_analyze_cc1 -analyzer-checker debug.ExprInspection -fheinous-gnu-extensions -w %s -verify + +int clang_analyzer_eval(int); + +int global; +void testRValueOutput() { + int &ref = global; + ref = 1; + __asm__("" : "=r"(((int)(global)))); // don't crash on rvalue output operand + clang_analyzer_eval(global == 1); // expected-warning{{UNKNOWN}} + clang_analyzer_eval(ref == 1); // expected-warning{{UNKNOWN}} +} |