• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===-- main.c --------------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #include <stdio.h>
10 
set_char(void)11 void set_char(void)
12 {
13     char i = 'a';
14     printf("before (char) i = %c\n", i);
15     printf("after  (char) i = %c\n", i);    // Set break point #1. //// break $source:$line
16 }
17 
set_uchar(void)18 void set_uchar(void)
19 {
20     unsigned char i = 'a';
21     printf("before (unsigned char) i = %c\n", i);
22     printf("after  (unsigned char) i = %c\n", i);   //// break $source:$line
23 }
24 
set_short(void)25 void set_short(void)
26 {
27     short i = 33;
28     printf("before (short) i = %i\n", i);
29     printf("after  (short) i = %i\n", i);   //// break $source:$line
30 }
31 
set_ushort(void)32 void set_ushort(void)
33 {
34     unsigned short i = 33;
35     printf("before (unsigned short) i = %i\n", i);
36     printf("after  (unsigned short) i = %i\n", i);  // Set break point #2. //// break $source:$line
37 }
38 
set_int(void)39 void set_int(void)
40 {
41     int i = 33;
42     printf("before (int) i = %i\n", i);
43     printf("after  (int) i = %i\n", i); //// break $source:$line
44 }
45 
set_uint(void)46 void set_uint(void)
47 {
48     unsigned int i = 33;
49     printf("before (unsigned int) i = %u\n", i);
50     printf("after  (unsigned int) i = %u\n", i);    //// break $source:$line
51 }
52 
set_long(void)53 void set_long(void)
54 {
55     long i = 33;
56     printf("before (long) i = %li\n", i);
57     printf("after  (long) i = %li\n", i);   // Set break point #3. //// break $source:$line
58 }
59 
set_ulong(void)60 void set_ulong(void)
61 {
62     unsigned long i = 33;
63     printf("before (unsigned long) i = %lu\n", i);
64     printf("after  (unsigned long) i = %lu\n", i);  //// break $source:$line
65 }
66 
set_float(void)67 void set_float(void)
68 {
69     float i = 3.1415927;
70     printf("before (float) i = %g\n", i);
71     printf("after  (float) i = %g\n", i);   //// break $source:$line
72 }
73 
set_double(void)74 void set_double(void)
75 {
76     double i = 3.1415927;
77     printf("before (double) i = %g\n", i);
78     printf("after  (double) i = %g\n", i);  // Set break point #4. //// break $source:$line
79 }
80 
set_long_double(void)81 void set_long_double(void)
82 {
83     long double i = 3.1415927;
84     printf("before (long double) i = %Lg\n", i);
85     printf("after  (long double) i = %Lg\n", i);    // Set break point #5. //// break $source:$line
86 }
87 
set_point(void)88 void set_point (void)
89 {
90     struct point_tag {
91         int x;
92         int y;
93     };
94     struct point_tag points_2[2] = {
95         {1,2},
96         {3,4}
97     };
98 }
99 
main(int argc,char const * argv[])100 int main (int argc, char const *argv[])
101 {
102     // Continue to the breakpoint in set_char()
103     set_char();         //// continue; var i; val -set 99 1
104     set_uchar();        //// continue; var i; val -set 99 2
105     set_short();        //// continue; var i; val -set -42 3
106     set_ushort();       //// continue; var i; val -set 42 4
107     set_int();          //// continue; var i; val -set -42 5
108     set_uint();         //// continue; var i; val -set 42 6
109     set_long();         //// continue; var i; val -set -42 7
110     set_ulong();        //// continue; var i; val -set 42 8
111     set_float();        //// continue; var i; val -set 123.456 9
112     set_double();       //// continue; var i; val -set 123.456 10
113     set_long_double();  //// continue; var i; val -set 123.456 11
114     set_point ();       //// continue
115     return 0;
116 }
117