source: CIVL/examples/languageFeatures/wrongMacro.c

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 784 bytes
Line 
1/* This file is suppose to show a buggy crash in CIVL when
2 * the user provides an undefined macro value.
3 * For example:
4 * civl verify -DMAC=mac_ooo wrongMacro.c
5 */
6#include <assert.h>
7#ifndef MAC
8#define MAC mac_zero
9#endif
10
11enum mac_numbers { mac_zero = 0, mac_one, mac_two};
12
13
14int main() {
15 enum mac_numbers mn = MAC;
16
17 if (mn == mac_one)
18 assert(mn == 1);
19 if (mn == mac_two)
20 assert(mn == 2);
21 return 0;
22}
Note: See TracBrowser for help on using the repository browser.