Revert "Roll NDK to r11c and extract it into its own repository."
[android_tools.git] / ndk / tests / device / test-cpufeatures / jni / test_android_setCpu_2.c
blob2466066789923a06459564bcd29170279919c851
1 #include <stdio.h>
2 #include <stdlib.h>
4 #include "cpu-features.h"
6 static void panic(const char* msg) {
7 fprintf(stderr, "ERROR: %s\n", msg);
8 exit(1);
11 int main(void) {
12 int count, cpu_count = 10;
13 uint64_t features, cpu_features = 0xaabdedf012934839ULL;
15 count = android_getCpuCount();
16 features = android_getCpuFeatures();
18 printf("Retrieved cpu_count=%d, features=%08llx\n",
19 count, features);
21 // Check that android_setCpu() will fail when it is called after
22 // android_getCpuCount / android_getCpuFeatures.
24 printf("Trying to set cpu_count=%d, features=%08llx\n",
25 cpu_count,
26 cpu_features);
28 if (android_setCpu(cpu_count, cpu_features))
29 panic("android_setCpu() call should have failed!");
31 printf("android_setCpu() call fail as expected.\n");
32 return 0;