brintos

brintos / llvm-project-archived public Read only

0
0
Text · 439 B · 9e4e471 Raw
21 lines · cpp
1// RUN: %clang_cc1 -emit-pch -o %t %s2// RUN: %clang_analyze_cc1 -error-on-deserialized-decl S1_method -include-pch %t -analyzer-checker=core %s3// RUN: %clang_analyze_cc1 -include-pch %t -analyzer-checker=core -verify %s4 5#ifndef HEADER6#define HEADER7// Header.8 9void S1_method(); // This should not be deserialized.10 11 12#else13// Using the header.14 15int test() {16  int x = 0;17  return 5/x; //expected-warning {{Division by zero}}18}19 20#endif21