Imported Upstream version 6.4.0.137

Former-commit-id: 943baa9f16a098c33e129777827f3a9d20da00d6
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-07-26 19:53:28 +00:00
parent e9207cf623
commit ef583813eb
2712 changed files with 74169 additions and 40587 deletions

View File

@@ -0,0 +1,5 @@
*.ll
*.exe
*.cbe
*.cexe
*.cbe.c

View File

@@ -0,0 +1,31 @@
CBE Warnings/Errors
1. "warning: conflicting types for built-in function
memcpy [enabled by default]"
Affecting:
test093.cbe.c:126:23
test095.cbe.c:121:23
This warning is generated when an array is declared and
initialized in the same line.
/*-----------------------*/
2. "error: cannot convert to a pointer type"
Affecting:
test089.cbe.c:158:3
test091.cbe.c:143:3
/*-----------------------*/
3. "warning: cast from pointer to integer of different size
[-Wpointer-to-int-cast]"
Affecting:
test101.cbe.c:214:10
test101.cbe.c:214:43

View File

@@ -0,0 +1,39 @@
#include <stdio.h>
int main()
{
int array[100], n, c, d, position, swap;
printf("Enter number of elements\n");
scanf("%d", &n);
printf("Enter %d integers\n", n);
for (c = 0; c < n; c++)
scanf("%d", &array[c]);
for (c = 0; c < (n - 1); c++)
{
position = c;
for (d = c +1; d < n; d++)
{
if (array[position] > array[d])
position = d;
}
if (position != c)
{
swap = array[c];
array[c] = array[position];
array[position] = swap;
}
}
printf("Sorted list in ascending order:\n");
for (c = 0; c < n; c++)
printf("%d\n", array[c]);
return 0;
}

View File

@@ -0,0 +1,17 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will return the correct number.
//
//===----------------------------------------------------------------------===//
int main()
{
return 6;
}

View File

@@ -0,0 +1,21 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a for loop correctly.
// *TW
//
//===----------------------------------------------------------------------===//
int main()
{
int i, x = 0;
for (i = 0; i < 6; i++)
++x;
return x;
}

View File

@@ -0,0 +1,23 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a while loop correctly.
// *TW
//===----------------------------------------------------------------------===//
int main()
{
int i = 0, x = 0;
while (i < 6) {
++x;
++i;
}
return x;
}

View File

@@ -0,0 +1,21 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute an if/else statement correctly.
// *TW
//===----------------------------------------------------------------------===//
int main() {
int x = 3;
x += 3;
if (x == 6)
return x;
else
return 0;
}

View File

@@ -0,0 +1,21 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a nested for loop correctly.
// *TW
//===----------------------------------------------------------------------===//
int main() {
int i, j, x = 0;
for (i = 0; i < 3; i++)
for (j = 0; j < 2; j++)
++x;
return x;
}

View File

@@ -0,0 +1,24 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a nested while loop correctly.
// *TW
//===----------------------------------------------------------------------===//
int main() {
int i = 0, j = 0, x = 0;
while (i < 6) {
while (j < 6) {
++x;
++j;
}
++i;
}
return x;
}

View File

@@ -0,0 +1,33 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a switch statement correctly.
// *TW
//===----------------------------------------------------------------------===//
int main() {
char var = 'x';
switch (var) {
case 'z' :
return 0;
break;
case 'y' :
return 1;
break;
case 'x' :
return 6;
break;
case 'w' :
return 7;
break;
default :
return 100;
}
}

View File

@@ -0,0 +1,29 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a struct correctly.
// *TW
//===----------------------------------------------------------------------===//
struct test {
int var1;
int var2;
int var3;
};
int main() {
struct test variable;
variable.var2 = 5;
variable.var3 = 6;
variable.var1 = 9;
return variable.var3;
}

View File

@@ -0,0 +1,21 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute an array correctly.
// *TW
//===----------------------------------------------------------------------===//
int main() {
int example[10];
int i;
for (i = 0;i < 10; ++i) {
example[i] = i;
}
return example[6];
}

View File

@@ -0,0 +1,43 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This code tests to see that the CBE will execute a nested switch statement correctly.
// *TW
//===----------------------------------------------------------------------===//
int main() {
char var = 'x', var2;
switch (var) {
case 'z' :
return 0;
break;
case 'y' :
return 1;
break;
case 'x' :
var2 = 'b';
switch (var2) {
case 'a' :
return 10;
break;
case 'b' :
return 6;
break;
default :
return 18;
}
case 'w' :
return 7;
break;
default :
return 100;
}
}

View File

@@ -0,0 +1,20 @@
//===-- CBackend.cpp - Library for converting LLVM code to C ----------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------------------------===//
//
// This code tests to see that the CBE can handle addition between two variables.
// *TW
//===------------------------------------------------------------------------===//
int main()
{
int i = 2, t = 4, x = 0;
x = i+t;
return x;
}

View File

@@ -0,0 +1,20 @@
//===-- CBackend.cpp - Library for converting LLVM code to C --------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------------===//
//
// This code tests to see that the CBE can handle subtraction between two variables.
// *TW
//===----------------------------------------------------------------------------===//
int main()
{
int i = 8, t = 2, x = 0;
x = i-t;
return x;
}

View File

@@ -0,0 +1,20 @@
//===-- CBackend.cpp - Library for converting LLVM code to C ----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------------------------------===//
//
// This code tests to see that the CBE can handle multiplication between two variables.
// *TW
//===------------------------------------------------------------------------------===//
int main()
{
int i = 3, t = 2, x = 0;
x = i*t;
return x;
}

View File

@@ -0,0 +1,20 @@
//===-- CBackend.cpp - Library for converting LLVM code to C ----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------------------------------===//
//
// This code tests to see that the CBE can handle division between two variables.
// *TW
//===------------------------------------------------------------------------------===//
int main()
{
int i = 30, t = 5, x = 0;
x = i/t;
return x;
}

View File

@@ -0,0 +1,20 @@
//===-- CBackend.cpp - Library for converting LLVM code to C ----------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------------------------------===//
//
// This code tests to see that the CBE can handle modulus between two variables.
// *TW
//===------------------------------------------------------------------------------===//
int main()
{
int i = 26, t = 20, x = 0;
x = i%t;
return x;
}

View File

@@ -0,0 +1,23 @@
//===-- CBackend.cpp - Library for converting LLVM code to C ----------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------------------------===//
//
// This code tests to see that the CBE can handle the unary plus (+a) operator.
// Increases the amount of space the char data type to 4.
// *TW
//===------------------------------------------------------------------------===//
int main(){
char ch;
if(sizeof(+ch) == 4) {
return 6;
}
return 1;
}

View File

@@ -0,0 +1,23 @@
//===-- CBackend.cpp - Library for converting LLVM code to C ----------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------------------------------===//
//
// This code tests to see that the CBE can handle the unary minus (-a) operator.
// *TW
//===------------------------------------------------------------------------===//
int main() {
signed int a = 10;
signed int b = -a;
if(b == -10) {
return 6;
}
return 1;
}

Some files were not shown because too many files have changed in this diff Show More