main
test-branch
| 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 |
|
|---|
| 11 | enum mac_numbers { mac_zero = 0, mac_one, mac_two};
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 | int 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.