declarations. These are the fixes that I was pretty confident about, there are
still a lot of other llvm-gcc warnings of which I'm not sure if they can be
safely ignored or fixed, without breaking the test case.
This fixes 11 testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52176
91177308-0d34-0410-b5e6-
96231b3b80d8
}
// Make sure that normal unions work. duh :)
-volatile union {
+volatile union U_t {
short S;
int i;
} U;
/* GCC wasn't handling 64 bit constants right fixed */
-void main() {
+#include <stdio.h>
+
+int main() {
long long Var = 123455678902ll;
printf("%lld\n", Var);
}
/* GCC is not outputting the static array to the LLVM backend, so bad things
* happen. Note that if this is defined static, everything seems fine.
*/
-void test(unsigned X) {
+double test(unsigned X) {
double student_t[30]={0.0 , 12.706 , 4.303 , 3.182 , 2.776 , 2.571 ,
2.447 , 2.365 , 2.306 , 2.262 , 2.228 ,
2.201 , 2.179 , 2.160 , 2.145 , 2.131 ,
return Global;
}
-void main() {
+int main() {
union X test = foo();
printf("0x%p", test.B);
}
// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
+#include <stdio.h>
+
union U{
int i[8];
char s[80];
// RUN: %llvmgcc -xc %s -c -o - | llvm-dis | grep llvm.memset | count 3
+#include <memory.h>
+
void test(int* X, char *Y) {
memset(X, 4, 1000);
bzero(Y, 100);
// RUN: %llvmgcc -O3 -xc %s -c -o - | llvm-dis | not grep builtin
+#include <math.h>
+
void zsqrtxxx(float num) {
num = sqrt(num);
}
-// RUN: %llvmgcc %s -S -o - -fno-math-errno | gccas | llvm-dis | grep llvm.sqrt
+// RUN: %llvmgcc %s -S -o - -fno-math-errno | grep llvm.sqrt
#include <math.h>
float foo(float X) {
int sub1(int i, char *pi) {
typedef int foo[i];
- struct bar {foo f1; int f2:3; int f3:4} *p = (struct bar *) pi;
+ struct bar {foo f1; int f2:3; int f3:4;} *p = (struct bar *) pi;
xxx(p->f1);
return p->f3;
}
// RUN: %llvmgcc -S %s -o -
// PR1708
+
+#include <stdlib.h>
+
struct s { _Complex unsigned short x; };
struct s gs = { 100 + 200i };
struct s __attribute__((noinline)) foo (void) { return gs; }
// RUN: %llvmgcc %s -S -emit-llvm -O1 -o - | grep {call.*ldexp}
// RUN: %llvmgcc %s -S -emit-llvm -O3 -fno-builtin -o - | grep {call.*exp2f}
+float exp2f(float);
+
float t4(unsigned char x) {
return exp2f(x);
}