Commit 8b68699e authored by Narayan Kamath's avatar Narayan Kamath Committed by Gerrit Code Review
Browse files

Merge "Remove dx/tests/120-disable-extend-ops"

parents dc003e0f 2eb5aa99
/*
* Copyright (C) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Blort
{
private int field0 = 0;
private int field1 = 1;
private int field2 = 2;
private int field3 = 3;
private int field4 = 4;
private int field5 = 5;
private int field6 = 6;
private int field7 = 7;
private int field8 = 8;
private int field9 = 9;
public void test() {
int v0 = field0;
int v1 = field1;
int v2 = field2;
int v3 = field3;
int v4 = field4;
int v5 = field5;
int v6 = field6;
int v7 = field7;
int v8 = field8;
int v9 = field9;
int v10 = field0;
int v11 = field1;
int v12 = field2;
int v13 = field3;
int v14 = field4;
int v15 = field5;
int v16 = field6;
int v17 = field7;
int v18 = field8;
int v19 = field9;
sink(v0);
sink(v1);
sink(v2);
sink(v3);
sink(v4);
sink(v5);
sink(v6);
sink(v7);
sink(v8);
sink(v9);
sink(v10);
sink(v11);
sink(v12);
sink(v13);
sink(v14);
sink(v15);
sink(v16);
sink(v17);
sink(v18);
sink(v19);
}
private static void sink(int arg) {
// This space intentionally left blank.
}
}
Done
This is a test of the dx option --target-api, which is supposed to
disable the emission of extended-opcode instructions when the target
API is for Honeycomb or earlier.
#!/bin/bash
#
# Copyright (C) 2011 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This test checks to see that without --target-api=11, the result of
# dx contains at least one "iget/jumbo" opcode (one example of an
# extended opcode); and that with that option no such opcode is
# produced.
$JAVAC -d . *.java
count=`dx --debug --dex --no-optimize --positions=none --no-locals \
--dump-method=Blort.test Blort.class | grep "iget/jumbo" | wc -l`
if [ "$count" = "0" ]; then
echo "No iget/jumbo emitted without --target-api"
fi
count=`dx --debug --dex --no-optimize --positions=none --no-locals \
--target-api=11 \
--dump-method=Blort.test Blort.class | grep "iget/jumbo" | wc -l`
if [ "$count" != "0" ]; then
echo "Found $count iget/jumbo emitted with --target-api=11"
fi
echo "Done"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment