Reviewed By: ddino Differential Revision: D3005671 fb-gh-sync-id: aa5d942 shipit-source-id: aa5d942master
parent
ef3e516f6f
commit
6c567f1104
@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2016 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define test(x) _Generic((x), _Bool : 1, char : 2, int : 3, default : 4)
|
||||||
|
|
||||||
|
int test_typename(void) {
|
||||||
|
char s;
|
||||||
|
int y;
|
||||||
|
int x = test(s);
|
||||||
|
int z = test(y);
|
@ -0,0 +1,17 @@
|
|||||||
|
digraph iCFG {
|
||||||
|
4 [label="4: DeclStmt \n *&x:void =_t$1 [line 15]\n NULLIFY(&x,false); [line 15]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
4 -> 3 ;
|
||||||
|
3 [label="3: DeclStmt \n *&z:void =_t$0 [line 16]\n NULLIFY(&z,false); [line 16]\n APPLY_ABSTRACTION; [line 16]\n " shape="box"]
|
||||||
|
|
||||||
|
|
||||||
|
3 -> 2 ;
|
||||||
|
2 [label="2: Exit test_typename \n " color=yellow style=filled]
|
||||||
|
|
||||||
|
|
||||||
|
1 [label="1: Start test_typename\nFormals: \nLocals: z:int x:int y:int s:char \n DECLARE_LOCALS(&return,&z,&x,&y,&s); [line 12]\n NULLIFY(&s,false); [line 12]\n NULLIFY(&x,false); [line 12]\n NULLIFY(&y,false); [line 12]\n NULLIFY(&z,false); [line 12]\n " color=yellow style=filled]
|
||||||
|
|
||||||
|
|
||||||
|
1 -> 4 ;
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2013 - present Facebook, Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the BSD style license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree. An additional grant
|
||||||
|
* of patent rights can be found in the PATENTS file in the same directory.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package frontend.c;
|
||||||
|
|
||||||
|
import org.junit.Rule;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import utils.DebuggableTemporaryFolder;
|
||||||
|
import utils.InferException;
|
||||||
|
import utils.ClangFrontendUtils;
|
||||||
|
|
||||||
|
public class UnusualExprTest {
|
||||||
|
|
||||||
|
@Rule
|
||||||
|
public DebuggableTemporaryFolder folder = new DebuggableTemporaryFolder();
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void whenCaptureRunEnumThenDotFilesAreTheSame()
|
||||||
|
throws InterruptedException, IOException, InferException {
|
||||||
|
String src = "infer/tests/codetoanalyze/c/frontend/unusual_exps/generic_exp.c";
|
||||||
|
ClangFrontendUtils.createAndCompareCDotFiles(folder, src);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue