summaryrefslogtreecommitdiff
path: root/nacl/okcompilers/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nacl/okcompilers/main.cpp')
-rw-r--r--nacl/okcompilers/main.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/nacl/okcompilers/main.cpp b/nacl/okcompilers/main.cpp
new file mode 100644
index 00000000..6255102c
--- /dev/null
+++ b/nacl/okcompilers/main.cpp
@@ -0,0 +1,22 @@
1extern "C" {
2 extern int not3(int);
3 extern int bytes(int);
4 extern long long shr32(long long);
5 extern double double5(void);
6}
7
8int main(int argc,char **argv)
9{
10 if (not3(3)) return 100;
11
12 /* on ppc32, gcc -mpowerpc64 produces SIGILL for >>32 */
13 if (!not3(shr32(1))) return 100;
14
15 /* on pentium 1, gcc -march=pentium2 produces SIGILL for (...+7)/8 */
16 if (bytes(not3(1)) != 1) return 100;
17
18 /* on pentium 1, gcc -march=prescott produces SIGILL for double comparison */
19 if (double5() < 0) return 100;
20
21 return 0;
22}