| 1 | void *D = 0; |
| 2 | |
| 3 | class D { |
| 4 | static int i; |
| 5 | }; |
| 6 | |
| 7 | int D::i = 3; |
| 8 | |
| 9 | namespace errno { |
| 10 | int j = 4; |
| 11 | }; |
| 12 | |
| 13 | int twice(int n) |
| 14 | { |
| 15 | return n * 2; //% self.expect("expression -- D::i", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "3"]) |
| 16 | //% self.expect("expression -- D", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["void"]) |
| 17 | //% self.expect("expression -- errno::j", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "4"]) |
| 18 | } |
| 19 | |
| 20 | const char getAChar() |
| 21 | { |
| 22 | const char D[] = "Hello world" ; |
| 23 | return D[0]; //% self.expect("expression -- D::i", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["int", "3"]) |
| 24 | //% self.expect("expression -- D", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["char", "Hello"]) |
| 25 | } |
| 26 | |
| 27 | int main (int argc, char const *argv[]) |
| 28 | { |
| 29 | int six = twice(n: 3); |
| 30 | return 0; |
| 31 | } |
| 32 | |