[ELF] Avoid make in elf::writeARMCmseImportLib
[llvm-project.git] / clang / test / Analysis / compound-literals.c
blobc74eacc3aa6831d95c273d068e1f436b17f3d1a4
1 // RUN: %clang_cc1 -triple=i386-apple-darwin10 -verify %s -analyze \
2 // RUN: -analyzer-checker=debug.ExprInspection
4 #define NULL 0
5 void clang_analyzer_eval(int);
7 // pr28449: Used to crash.
8 void foo(void) {
9 static const unsigned short array[] = (const unsigned short[]){0x0F00};
10 clang_analyzer_eval(array[0] == 0x0F00); // expected-warning{{TRUE}}
13 // check that we propagate info through compound literal regions
14 void bar(void) {
15 int *integers = (int[]){1, 2, 3};
16 clang_analyzer_eval(integers[0] == 1); // expected-warning{{TRUE}}
17 clang_analyzer_eval(integers[1] == 2); // expected-warning{{TRUE}}
18 clang_analyzer_eval(integers[2] == 3); // expected-warning{{TRUE}}
20 int **pointers = (int *[]){&integers[0], NULL};
21 clang_analyzer_eval(pointers[0] == NULL); // expected-warning{{FALSE}}
22 clang_analyzer_eval(pointers[1] == NULL); // expected-warning{{TRUE}}