1float f_neg3 = 1.234567 / 1e3;
2float f_neg4 = 1.234567 / 1e4;
3float f_neg5 = 1.234567 / 1e5;
4float f_neg6 = 1.234567 / 1e6;
5float f_neg7 = 1.234567 / 1e7;
6float f_neg8 = 1.234567 / 1e8;
7float f_neg20 = 1.234567 / 1e20;
8float f_neg30 = 1.234567 / 1e30;
9
10float f_3 = 1.234567 * 1e3;
11float f_4 = 1.234567 * 1e4;
12float f_5 = 1.234567 * 1e5;
13float f_6 = 1.234567 * 1e6;
14float f_7 = 1.234567 * 1e7;
15float f_8 = 1.234567 * 1e8;
16float f_20 = 1.234567 * 1e20;
17float f_30 = 1.234567 * 1e30;
18
19double d_neg3 = 1.234567 / 1e3;
20double d_neg4 = 1.234567 / 1e4;
21double d_neg5 = 1.234567 / 1e5;
22double d_neg6 = 1.234567 / 1e6;
23double d_neg7 = 1.234567 / 1e7;
24double d_neg8 = 1.234567 / 1e8;
25double d_neg20 = 1.234567 / 1e20;
26double d_neg30 = 1.234567 / 1e30;
27double d_neg50 = 1.234567 / 1e50;
28double d_neg250 = 1.234567 / 1e250;
29
30double d_3 = 1.234567 * 1e3;
31double d_4 = 1.234567 * 1e4;
32double d_5 = 1.234567 * 1e5;
33double d_6 = 1.234567 * 1e6;
34double d_7 = 1.234567 * 1e7;
35double d_8 = 1.234567 * 1e8;
36double d_20 = 1.234567 * 1e20;
37double d_30 = 1.234567 * 1e30;
38double d_50 = 1.234567 * 1e50;
39double d_250 = 1.234567 * 1e250;
40
41int main (int argc, char const *argv[]) {
42 //% # Default setting should be 6.
43 //% self.expect("frame variable f_neg3", substrs=["0.00123456"])
44 //% self.expect("frame variable f_neg4", substrs=["0.000123456"])
45 //% self.expect("frame variable f_neg5", substrs=["0.0000123456"])
46 //% self.expect("frame variable f_neg6", substrs=["0.00000123456"])
47 //% self.expect("frame variable f_neg7", substrs=["1.234567", "E-7"])
48 //% self.expect("frame variable f_neg8", substrs=["1.23456", "E-8"])
49 //% self.expect("frame variable f_neg20", substrs=["E-20"])
50 //% self.expect("frame variable f_neg30", substrs=["E-30"])
51 //% self.expect("frame variable f_3", substrs=["1234.56"])
52 //% self.expect("frame variable f_4", substrs=["12345.6"])
53 //% self.expect("frame variable f_5", substrs=["123456"])
54 //% self.expect("frame variable f_6", substrs=["123456"])
55 //% self.expect("frame variable f_7", substrs=["123456"])
56 //% self.expect("frame variable f_8", substrs=["123456"])
57 //% self.expect("frame variable f_20", substrs=["E+20"])
58 //% self.expect("frame variable f_30", substrs=["E+30"])
59 //% self.expect("frame variable d_neg3", substrs=["0.00123456"])
60 //% self.expect("frame variable d_neg4", substrs=["0.000123456"])
61 //% self.expect("frame variable d_neg5", substrs=["0.0000123456"])
62 //% self.expect("frame variable d_neg6", substrs=["0.00000123456"])
63 //% self.expect("frame variable d_neg7", substrs=["1.23456", "E-7"])
64 //% self.expect("frame variable d_neg8", substrs=["1.23456", "E-8"])
65 //% self.expect("frame variable d_neg20", substrs=["1.23456", "E-20"])
66 //% self.expect("frame variable d_neg30", substrs=["1.23456", "E-30"])
67 //% self.expect("frame variable d_neg50", substrs=["1.23456", "E-50"])
68 //% self.expect("frame variable d_neg250", substrs=["E-250"])
69 //% self.expect("frame variable d_3", substrs=["1234.56"])
70 //% self.expect("frame variable d_4", substrs=["12345.6"])
71 //% self.expect("frame variable d_5", substrs=["123456"])
72 //% self.expect("frame variable d_6", substrs=["1234567"])
73 //% self.expect("frame variable d_7", substrs=["1234567"])
74 //% self.expect("frame variable d_8", substrs=["1234567"])
75 //% self.expect("frame variable d_20", substrs=["1.23456", "E+20"])
76 //% self.expect("frame variable d_30", substrs=["1.23456", "E+30"])
77 //% self.expect("frame variable d_50", substrs=["1.23456", "E+50"])
78 //% self.expect("frame variable d_250", substrs=["1.23456", "E+250"])
79 //% # Now change the setting to print all the zeroes.
80 //% # Note that changing this setting should invalidate the data visualizer
81 //% # cache so that the new setting is used in the following calls.
82 //% self.runCmd("settings set target.max-zero-padding-in-float-format 9999")
83 //% self.expect("frame variable f_neg3", substrs=["0.00123456"])
84 //% self.expect("frame variable f_neg4", substrs=["0.000123456"])
85 //% self.expect("frame variable f_neg5", substrs=["0.0000123456"])
86 //% self.expect("frame variable f_neg6", substrs=["0.00000123456"])
87 //% self.expect("frame variable f_neg7", substrs=["0.000000123456"])
88 //% self.expect("frame variable f_neg8", substrs=["0.0000000123456"])
89 //% self.expect("frame variable f_neg20", substrs=["0.0000000000000000000123456"])
90 //% self.expect("frame variable f_neg30", substrs=["0.00000000000000000000000000000123456"])
91 //% self.expect("frame variable f_3", substrs=["1234.56"])
92 //% self.expect("frame variable f_4", substrs=["12345.6"])
93 //% self.expect("frame variable f_5", substrs=["123456"])
94 //% self.expect("frame variable f_6", substrs=["1234567"])
95 //% self.expect("frame variable f_7", substrs=["1234567"])
96 //% self.expect("frame variable f_8", substrs=["1234567"])
97 //% self.expect("frame variable f_20", substrs=["E+20"])
98 //% self.expect("frame variable f_30", substrs=["E+30"])
99 //% self.expect("frame variable d_neg3", substrs=["0.00123456"])
100 //% self.expect("frame variable d_neg4", substrs=["0.000123456"])
101 //% self.expect("frame variable d_neg5", substrs=["0.0000123456"])
102 //% self.expect("frame variable d_neg6", substrs=["0.00000123456"])
103 //% self.expect("frame variable d_neg7", substrs=["0.000000123456"])
104 //% self.expect("frame variable d_neg8", substrs=["0.0000000123456"])
105 //% self.expect("frame variable d_neg20", substrs=["0.0000000000000000000123456"])
106 //% self.expect("frame variable d_neg30", substrs=["0.000000000000000000000000000001234567"])
107 //% self.expect("frame variable d_neg50", substrs=["0.0000000000000000000000000000000000000000000000000123456"])
108 //% self.expect("frame variable d_neg250", substrs=["0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000123456"])
109 //% self.expect("frame variable d_3", substrs=["1234.56"])
110 //% self.expect("frame variable d_4", substrs=["12345.6"])
111 //% self.expect("frame variable d_5", substrs=["123456"])
112 //% self.expect("frame variable d_6", substrs=["1234567"])
113 //% self.expect("frame variable d_7", substrs=["1234567"])
114 //% self.expect("frame variable d_8", substrs=["1234567"])
115 //% # Positive numbers are not affected by this setting.
116 //% self.expect("frame variable d_20", substrs=["1.23456", "E+20"])
117 //% self.expect("frame variable d_30", substrs=["1.23456", "E+30"])
118 //% self.expect("frame variable d_50", substrs=["1.23456", "E+50"])
119 //% self.expect("frame variable d_250", substrs=["1.23456", "E+250"])
120 return 0;
121}
122

source code of lldb/test/API/functionalities/float-display/main.c