Add basic integration test for assembly code

Summary: Make sure that infer ignores the .S file and still finds an issue in `hello.c`

Reviewed By: jvillard

Differential Revision: D4110622

fbshipit-source-id: 32f907e
master
Andrzej Kotulski 8 years ago committed by Facebook Github Bot
parent 6b793a34b5
commit 71b73368ec

@ -61,6 +61,7 @@ EXPECTED_OUTPUTS_DIR = os.path.join(SCRIPT_DIR, 'expected_outputs')
ALL_TESTS = [
'ant',
'assembly',
'buck',
'cc1',
'cmake',
@ -496,6 +497,11 @@ class BuildIntegrationTest(unittest.TestCase):
[],
preprocess=preprocess)
def test_clang_assembly(self):
test('assembly', 'compile with assembly code', CODETOANALYZE_DIR,
[{'compile': ['clang', '-x', 'c', '-c', 'hello.c', '-x',
'assembler-with-cpp', 'example.S']}])
def test_clang_component_kit_imports(self):
test('componentkit', 'component quality analyzer skips imports',
os.path.join(CODETOANALYZE_DIR, 'componentkit'),

@ -0,0 +1,20 @@
/*
* 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.
*/
// THIS CODE HAS NO REAL MEANING, DO NOT TRY TO USE IT
.file "example.S"
.text
test:
pushq %rbp
movq %rsp, %rbp
movl %edi, -4(%rbp)
movl -4(%rbp), %eax
addl $1, %eax
popq %rbp
ret

@ -0,0 +1,7 @@
[
{
"bug_type": "NULL_DEREFERENCE",
"file": "hello.c",
"procedure": "test"
}
]
Loading…
Cancel
Save