|
1 |
| -// skip-filecheck |
2 | 1 | // unit-test: DataflowConstProp
|
3 | 2 | // EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
4 | 3 |
|
@@ -29,18 +28,46 @@ struct Delta<T> {
|
29 | 28 | }
|
30 | 29 |
|
31 | 30 | // EMIT_MIR offset_of.concrete.DataflowConstProp.diff
|
| 31 | + |
| 32 | +// CHECK-LABEL: fn concrete |
32 | 33 | fn concrete() {
|
| 34 | + // CHECK: debug x => [[x:_.*]]; |
| 35 | + // CHECK: debug y => [[y:_.*]]; |
| 36 | + // CHECK: debug z0 => [[z0:_.*]]; |
| 37 | + // CHECK: debug z1 => [[z1:_.*]]; |
| 38 | + |
| 39 | + // CHECK: [[x]] = must_use::<usize>(const 4_usize) -> [return: {{bb[0-9]+}}, unwind continue]; |
33 | 40 | let x = offset_of!(Alpha, x);
|
| 41 | + |
| 42 | + // CHECK: [[y]] = must_use::<usize>(const 0_usize) -> [return: {{bb[0-9]+}}, unwind continue]; |
34 | 43 | let y = offset_of!(Alpha, y);
|
| 44 | + |
| 45 | + // CHECK: [[z0]] = must_use::<usize>(const 2_usize) -> [return: {{bb[0-9]+}}, unwind continue]; |
35 | 46 | let z0 = offset_of!(Alpha, z.0);
|
| 47 | + |
| 48 | + // CHECK: [[z1]] = must_use::<usize>(const 3_usize) -> [return: {{bb[0-9]+}}, unwind continue]; |
36 | 49 | let z1 = offset_of!(Alpha, z.1);
|
37 | 50 | }
|
38 | 51 |
|
39 | 52 | // EMIT_MIR offset_of.generic.DataflowConstProp.diff
|
| 53 | + |
| 54 | +// CHECK-LABEL: generic |
40 | 55 | fn generic<T>() {
|
| 56 | + // CHECK: debug gx => [[gx:_.*]]; |
| 57 | + // CHECK: debug gy => [[gy:_.*]]; |
| 58 | + // CHECK: debug dx => [[dx:_.*]]; |
| 59 | + // CHECK: debug dy => [[dy:_.*]]; |
| 60 | + |
| 61 | + // CHECK: [[gx]] = must_use::<usize>(move {{_[0-9]+}}) -> [return: {{bb[0-9]+}}, unwind continue]; |
41 | 62 | let gx = offset_of!(Gamma<T>, x);
|
| 63 | + |
| 64 | + // CHECK: [[gy]] = must_use::<usize>(move {{_[0-9]+}}) -> [return: {{bb[0-9]+}}, unwind continue]; |
42 | 65 | let gy = offset_of!(Gamma<T>, y);
|
| 66 | + |
| 67 | + // CHECK: [[dx]] = must_use::<usize>(const 0_usize) -> [return: {{bb[0-9]+}}, unwind continue]; |
43 | 68 | let dx = offset_of!(Delta<T>, x);
|
| 69 | + |
| 70 | + // CHECK: [[dy]] = must_use::<usize>(const 2_usize) -> [return: {{bb[0-9]+}}, unwind continue]; |
44 | 71 | let dy = offset_of!(Delta<T>, y);
|
45 | 72 | }
|
46 | 73 |
|
|
0 commit comments