summaryrefslogtreecommitdiff
path: root/util/romcc/tests
diff options
context:
space:
mode:
Diffstat (limited to 'util/romcc/tests')
-rw-r--r--util/romcc/tests/simple_test19.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/util/romcc/tests/simple_test19.c b/util/romcc/tests/simple_test19.c
new file mode 100644
index 0000000000..0bdcf422ef
--- /dev/null
+++ b/util/romcc/tests/simple_test19.c
@@ -0,0 +1,24 @@
+static void hlt(void)
+{
+ __builtin_hlt();
+}
+
+typedef __builtin_msr_t msr_t;
+
+static msr_t rdmsr(unsigned long index)
+{
+ return __builtin_rdmsr(index);
+}
+
+static void wrmsr(unsigned long index, msr_t msr)
+{
+ __builtin_wrmsr(index, msr.lo, msr.hi);
+}
+
+static void main(void)
+{
+ msr_t msr;
+ msr = rdmsr(0x1234);
+ msr.lo &= ~(1<<5);
+ wrmsr(0x1234, msr);
+}