Skip to content

Commit 80fb2f2

Browse files
debuginfo: Added test cases for static struct and enum methods.
1 parent 5abb7c3 commit 80fb2f2

File tree

2 files changed

+134
-0
lines changed

2 files changed

+134
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// compile-flags:-Z extra-debug-info
14+
// debugger:break zzz
15+
// debugger:run
16+
17+
// STRUCT
18+
// debugger:finish
19+
// debugger:print arg1
20+
// check:$1 = 1
21+
// debugger:print arg2
22+
// check:$2 = 2
23+
// debugger:continue
24+
25+
// ENUM
26+
// debugger:finish
27+
// debugger:print arg1
28+
// check:$3 = -3
29+
// debugger:print arg2
30+
// check:$4 = 4.5
31+
// debugger:print arg3
32+
// check:$5 = 5
33+
// debugger:continue
34+
35+
36+
struct Struct {
37+
x: int
38+
}
39+
40+
impl Struct {
41+
42+
fn static_method<T1, T2>(arg1: T1, arg2: T2) -> int {
43+
zzz();
44+
return 0;
45+
}
46+
}
47+
48+
enum Enum {
49+
Variant1 { x: int },
50+
Variant2,
51+
Variant3(float, int, char),
52+
}
53+
54+
impl Enum {
55+
56+
fn static_method<T1, T2, T3>(arg1: T1, arg2: T2, arg3: T3) -> int {
57+
zzz();
58+
return 1;
59+
}
60+
}
61+
62+
fn main() {
63+
Struct::static_method(1, 2);
64+
Enum::static_method(-3, 4.5, 5);
65+
}
66+
67+
fn zzz() {()}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-win32 Broken because of LLVM bug: http://llvm.org/bugs/show_bug.cgi?id=16249
12+
13+
// compile-flags:-Z extra-debug-info
14+
// debugger:break zzz
15+
// debugger:run
16+
17+
// STRUCT
18+
// debugger:finish
19+
// debugger:print arg1
20+
// check:$1 = 1
21+
// debugger:print arg2
22+
// check:$2 = 2
23+
// debugger:continue
24+
25+
// ENUM
26+
// debugger:finish
27+
// debugger:print arg1
28+
// check:$3 = -3
29+
// debugger:print arg2
30+
// check:$4 = 4.5
31+
// debugger:print arg3
32+
// check:$5 = 5
33+
// debugger:continue
34+
35+
36+
struct Struct {
37+
x: int
38+
}
39+
40+
impl Struct {
41+
42+
fn static_method(arg1: int, arg2: int) -> int {
43+
zzz();
44+
arg1 + arg2
45+
}
46+
}
47+
48+
enum Enum {
49+
Variant1 { x: int },
50+
Variant2,
51+
Variant3(float, int, char),
52+
}
53+
54+
impl Enum {
55+
56+
fn static_method(arg1: int, arg2: float, arg3: uint) -> int {
57+
zzz();
58+
arg1
59+
}
60+
}
61+
62+
fn main() {
63+
Struct::static_method(1, 2);
64+
Enum::static_method(-3, 4.5, 5);
65+
}
66+
67+
fn zzz() {()}

0 commit comments

Comments
 (0)