1 /* Integration test to verify that we don't explode in this
2 argument-parsing logic.
3 Adapted from part of bzip2-1.0.8: bzip2.c: main. */
7 #include "analyzer-decls.h"
9 /* This test file has been heavily modified from the bzip2.c original,
10 which has the following license boilerplate. */
11 /* ------------------------------------------------------------------
12 This file is part of bzip2/libbzip2, a program and library for
13 lossless, block-sorting data compression.
15 bzip2/libbzip2 version 1.0.8 of 13 July 2019
16 Copyright (C) 1996-2019 Julian Seward <jseward@acm.org>
18 Please read the WARNING, DISCLAIMER and PATENTS sections in the
21 This program is released under the terms of the license contained
23 ------------------------------------------------------------------ */
26 typedef unsigned char Bool
;
29 #define True ((Bool)1)
30 #define False ((Bool)0)
40 Bool keepInputFiles
, smallMode
;
41 Bool forceOverwrite
, noisy
;
47 extern void license ( void );
48 extern void usage ( Char
*fullProgName
);
50 void test (Cell
*argList
)
55 for (aa
= argList
; aa
!= NULL
; aa
= aa
->link
) {
56 if (aa
->name
[0] == '-' && aa
->name
[1] != '-') {
57 for (j
= 1; aa
->name
[j
] != '\0'; j
++) {
58 switch (aa
->name
[j
]) {
59 case 'c': srcMode
= 2; break;
60 case 'd': opMode
= 2; break;
61 case 'z': opMode
= 1; break;
62 case 'f': forceOverwrite
= True
; break;
63 case 't': opMode
= 3; break;
64 case 'k': keepInputFiles
= True
; break;
65 case 's': smallMode
= True
; break;
66 case 'q': noisy
= False
; break;
67 case '1': blockSize100k
= 1; break;
68 case '2': blockSize100k
= 2; break;
69 case '3': blockSize100k
= 3; break;
70 case '4': blockSize100k
= 4; break;
71 case '5': blockSize100k
= 5; break;
72 case '6': blockSize100k
= 6; break;
73 case '7': blockSize100k
= 7; break;
74 case '8': blockSize100k
= 8; break;
75 case '9': blockSize100k
= 9; break;
77 case 'L': license(); break;
78 case 'v': verbosity
++; break;
79 case 'h': usage ( progName
);
82 default: fprintf ( stderr
, "%s: Bad flag `%s'\n",
92 /* The analyzer ought to be able to successfully merge all of the
93 above changes that can reach here into a single state. */
94 __analyzer_dump_exploded_nodes (0); /* { dg-warning "1 processed enode" } */