summaryrefslogtreecommitdiff
path: root/valid/code-0015.smali
blob: c1cf6bdcd1d4f878044ebc64bc99d101c8712186 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70

.class public LBytecodeDemo;
.super Ljava/lang/Object;

.method public constructor <init>()V
    .locals 0

    return-void
.end method

.method public testDataHandling()V
    .locals 3

    const/16 v0, 0x1234
    const/16 v1, 0x5678
    add-int v0, v0, v1
    iput v0, p0, LBytecodeDemo;->field:I
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
    iget v1, p0, LBytecodeDemo;->field:I
    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(I)V

    return-void
.end method

.method public testArithmeticLogic()V
    .locals 3

    const/4 v0, 0x5
    const/4 v1, 0x3
    add-int/lit8 v2, v0, 0x2
    mul-int v0, v2, v1
    div-int v0, v0, v1
    rem-int v0, v0, v1
    neg-int v0, v0

    return-void
.end method

.method public testControlFlow()V
    .locals 1

    const/4 v0, 0x5

    if-eqz v0, :cond_true
    goto :cond_false

:cond_true
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
    const-string v1, "Condition is true"
    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
    goto :end_if

:cond_false
    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
    const-string v1, "Condition is false"
    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

:end_if
    return-void
.end method

.method public testDex38Instructions()V
    .locals 2

    sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
    const-string v1, "Hello from Dex 38"
    invoke-virtual {v0, v1}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V

    return-void
.end method