Skip to content

Commit cf56b95

Browse files
committed
Add #[track_caller] test.
1 parent 0bbea9e commit cf56b95

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/ui/lang/panic/track_caller.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Test that propagating `#[track_caller]` doesn't cause constant-related errors.
2+
3+
// build-pass
4+
5+
use spirv_std as _;
6+
7+
#[track_caller]
8+
fn track_caller_maybe_panic(x: u32) {
9+
if x > 0 {
10+
panic!();
11+
}
12+
}
13+
14+
#[spirv(fragment)]
15+
pub fn main(x: u32) {
16+
track_caller_maybe_panic(x);
17+
}

0 commit comments

Comments
 (0)