xref: /llvm-project/clang/test/Analysis/exploded-graph-rewriter/l_name_starts_with_l.cpp (revision 5ce7050f701c6907cc2522fc43d39a8cbcc119d2)
1 // CAUTION: The name of this file should start with `l` for proper tests.
2 // FIXME: Figure out how to use %clang_analyze_cc1 with our lit.local.cfg.
3 // RUN: %clang_cc1 -analyze -triple x86_64-unknown-linux-gnu \
4 // RUN:                     -analyzer-checker=core \
5 // RUN:                     -analyzer-dump-egraph=%t.dot %s
6 // RUN: %exploded_graph_rewriter %t.dot | FileCheck %s
7 
test1()8 void test1() {
9   // Here __FILE__ macros produces a string with `\` delimiters on Windows
10   // and the name of the file starts with `l`.
11   char text[] = __FILE__;
12 }
13 
test2()14 void test2() {
15   // Here `\l` is in the middle of the literal.
16   char text[] = "string\\literal";
17 }
18 
test()19 void test() {
20   test1();
21   test2();
22 }
23 
24 // This test is passed if exploded_graph_rewriter handles dot file without errors.
25 // CHECK: digraph "ExplodedGraph"
26 // CHECK: shape=record,label=<<table border="0">
27 // CHECK: char text[] = "string\\literal";
28