return 0;
}
-void test_rewrite_includes() {
+void test_rewrite_includes(void) {
__builtin_va_list argp;
vprintf("string", argp);
}
}
// Check nested function declarators work.
-int f(void (*g)(), enum {AA,BB} h) {
+int f(void (*g)(void), enum {AA,BB} h) {
// CHECK: ret i32 0
return AA;
}
// CHECK: @test7 = {{(dso_local )?}}global [2 x %struct.test7s] [%struct.test7s { i32 1, i32 2 }, %struct.test7s { i32 4, i32 0 }]
-void test1() {
+void test1(void) {
// This should codegen as a "@test1.x" global.
const int x[] = { 1, 2, 3, 4, 6, 8, 9, 10, 123, 231, 123,23 };
foo(x);
// rdar://7346691
-void test2() {
+void test2(void) {
// This should codegen as a "@test2.x" global + memcpy.
int x[] = { 1, 2, 3, 4, 6, 8, 9, 10, 123, 231, 123,23, 24 };
foo(x);
}
-void test3() {
+void test3(void) {
// This should codegen as a memset.
int x[100] = { 0 };
foo(x);
union test5u { int i; double d; };
-void test5() {
+void test5(void) {
union test5u ola = (union test5u) 351;
union test5u olb = (union test5u) 1.0;
}
int iMem;
};
-void test6() {
+void test6(void) {
struct SelectDest x = {1, 2, 3};
test6f(&x);
}
// CHECK-LABEL: define{{.*}} i32 @test1()
// CHECK: load i32, i32* addrspacecast{{[^@]+}} @foo
-int test1() { return foo; }
+int test1(void) { return foo; }
// CHECK-LABEL: define{{.*}} i32 @test2(i32 noundef %i)
// CHECK: %[[addr:.*]] = getelementptr
// CHECK: load i32, i32*
// CHECK: load i32*, i32** addrspacecast{{.*}} @A
// CHECK: store i32 {{.*}}, i32*
-void test3() {
+void test3(void) {
*A = *B;
}
// RUN: %clang_cc1 -triple x86_64-unknown-linux -default-function-attr foo=bar -emit-llvm %s -o - | FileCheck %s
// CHECK: define{{.*}} void @foo() #[[X:[0-9]+]]
-void foo() {}
+void foo(void) {}
// CHECK: attributes #[[X]] = {{.*}} "foo"="bar"
// CHECK-PS: attributes #0 = {{.*}}"denormal-fp-math"="preserve-sign,preserve-sign"{{.*}}
// CHECK-PZ: attributes #0 = {{.*}}"denormal-fp-math"="positive-zero,positive-zero"{{.*}}
-int main() {
+int main(void) {
return 0;
}
// LINUX: !llvm.dependent-libraries = !{![[msvcrt:[0-9]+]]}
// LINUX: ![[msvcrt]] = !{!"msvcrt"}
-int f();
+int f(void);
};
};
-void test2() {
+void test2(void) {
struct S *btkr;
*btkr = (struct S) {
// expected-warning@+1 {{'extern' variable has an initializer}}
extern int const z = 4;
-int main() {
+int main(void) {
int a = x + y + z;
return a;
}
#define JOIN2(x, y) x##y
#define JOIN(x, y) JOIN2(x, y)
-#define USEVAR(var) int JOIN(use, __LINE__)() { return var; }
-#define USE(func) void JOIN(use, __LINE__)() { func(); }
+#define USEVAR(var) int JOIN(use, __LINE__)(void) { return var; }
+#define USE(func) void JOIN(use, __LINE__)(void) { func(); }
// Redeclaration in local context.
// CHECK: @GlobalRedecl6 = external dllimport global i32
__declspec(dllimport) int GlobalRedecl6;
-int functionScope() {
+int functionScope(void) {
extern int GlobalRedecl6; // still dllimport
return GlobalRedecl6;
}
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
-int bar();
-int test0() {
+int bar(void);
+int test0(void) {
int i;
i = 1 + 2;
do {
}
-int test1() {
+int test1(void) {
int i;
i = 1 + 2;
do {
}
-int test2() {
+int test2(void) {
int i;
i = 1 + 2;
do {
}
-int test3() {
+int test3(void) {
int i;
i = 1 + 2;
do {
}
-int test4() {
+int test4(void) {
int i;
i = 1 + 2;
do {
}
// rdar://6103124
-void test5() {
+void test5(void) {
do { break; } while(0);
}
// PR14191
void test6f(void);
-void test6() {
+void test6(void) {
do {
} while (test6f(), 0);
// CHECK: call {{.*}}void @test6f()
extern int bar;
__attribute__((dllimport)) void import_func(void);
-int *use_import() {
+int *use_import(void) {
import_func();
return &import_var;
}
void foo(void);
-int *zed() {
+int *zed(void) {
foo();
return baz ? &weak_bar : &bar;
}
return 0;
}
-void unit1() {
+void unit1(void) {
struct U1A {
short a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit2() {
+void unit2(void) {
struct U2A {
unsigned short a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit3() {
+void unit3(void) {
struct U3A {
int a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit4() {
+void unit4(void) {
struct U4A {
unsigned int a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit5() {
+void unit5(void) {
struct U5A {
long a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit6() {
+void unit6(void) {
struct U6A {
unsigned long a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit7() {
+void unit7(void) {
struct U7A {
long long a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit8() {
+void unit8(void) {
struct U8A {
unsigned long long a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit9() {
+void unit9(void) {
struct U9A {
char a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit10() {
+void unit10(void) {
struct U10A {
char *a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit11() {
+void unit11(void) {
struct U11A {
void *a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit12() {
+void unit12(void) {
struct U12A {
const char *a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit13() {
+void unit13(void) {
typedef char *charstar;
struct U13A {
const charstar a;
__builtin_dump_struct(&a, &printf);
}
-void unit14() {
+void unit14(void) {
struct U14A {
double a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit15() {
+void unit15(void) {
struct U15A {
int a[3];
};
__builtin_dump_struct(&a, &printf);
}
-void unit16() {
+void unit16(void) {
struct U16A {
uint8_t a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit17() {
+void unit17(void) {
struct U17A {
int8_t a;
};
__builtin_dump_struct(&a, &printf);
}
-void unit18() {
+void unit18(void) {
struct U18A {
long double a;
};
__builtin_dump_struct(&a, &printf);
}
-void test1() {
+void test1(void) {
struct T1A {
int a;
char *b;
__builtin_dump_struct(&a, &printf);
}
-void test2() {
+void test2(void) {
struct T2A {
int a;
};
__builtin_dump_struct(&b, &printf);
}
-void test3() {
+void test3(void) {
struct T3A {
union {
int a;
__builtin_dump_struct(&a, &printf);
}
-void test4() {
+void test4(void) {
struct T4A {
union {
struct {
// RUN: %clang_cc1 -femit-all-decls -emit-llvm -o %t %s
// RUN: grep "@foo" %t
-static void foo() {
+static void foo(void) {
}
// RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc -disable-llvm-passes < %s -o %t.bc
// RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc -x ir < %t.bc | llvm-bcanalyzer -dump | FileCheck --check-prefix=LTOINDEX %s
-int main() {}
+int main(void) {}
} u;
};
-struct Mem *columnMem(){
+struct Mem *columnMem(void){
static const struct Mem nullMem = { {} };
}
void foo(int m) __attribute__((overloadable));
// CHECK-LABEL: define{{.*}} void @test1
-void test1() {
+void test1(void) {
// CHECK: store void (i32)* @_Z3fooi
void (*p)(int) = foo;
// CHECK: store void (i32)* @_Z3fooi
void bar(int m) __attribute__((overloadable, enable_if(m > 0, "")));
void bar(int m) __attribute__((overloadable, enable_if(1, "")));
// CHECK-LABEL: define{{.*}} void @test2
-void test2() {
+void test2(void) {
// CHECK: store void (i32)* @_Z3barUa9enable_ifILi1EEi
void (*p)(int) = bar;
// CHECK: store void (i32)* @_Z3barUa9enable_ifILi1EEi
void baz(int m) __attribute__((overloadable, enable_if(1, "")));
void baz(int m) __attribute__((overloadable));
// CHECK-LABEL: define{{.*}} void @test3
-void test3() {
+void test3(void) {
// CHECK: store void (i32)* @_Z3bazUa9enable_ifILi1EEi
void (*p)(int) = baz;
// CHECK: store void (i32)* @_Z3bazUa9enable_ifILi1EEi
enable_if(TRUEFACTS, "")));
void qux(int m) __attribute__((overloadable, enable_if(1, "")));
// CHECK-LABEL: define{{.*}} void @test4
-void test4() {
+void test4(void) {
// CHECK: store void (i32)* @_Z3quxUa9enable_ifILi1ELi1EEi
void (*p)(int) = qux;
// CHECK: store void (i32)* @_Z3quxUa9enable_ifILi1ELi1EEi
// wouldn't pay attention to lower-priority attributes.
// (N.B. `foo` with pass_object_size should always be preferred)
// CHECK-LABEL: define{{.*}} void @test5
-void test5() {
+void test5(void) {
int foo(char *i) __attribute__((enable_if(1, ""), overloadable));
int foo(char *i __attribute__((pass_object_size(0))))
__attribute__((enable_if(1, ""), overloadable));
// CHECK: store i32 %[[abnormal_zext]], i32* @crashed
// CHECK-NEXT: ret void
-void noreturn_noop_finally() {
+void noreturn_noop_finally(void) {
__try {
__noop();
} __finally {
// CHECK: call void @abort()
// CHECK: unreachable
-void noreturn_finally() {
+void noreturn_finally(void) {
__try {
might_crash();
} __finally {
// CHECK: call void @abort()
// CHECK: unreachable
-int finally_with_return() {
+int finally_with_return(void) {
__try {
return 42;
} __finally {
// CHECK-NOT: br label
// CHECK: ret void
-int nested___finally___finally() {
+int nested___finally___finally(void) {
__try {
__try {
} __finally {
// FIXME: Our behavior seems suspiciously different.
-int nested___finally___finally_with_eh_edge() {
+int nested___finally___finally_with_eh_edge(void) {
__try {
__try {
might_crash();
// CHECK-SAME: [[finally_attrs]]
// CHECK: unreachable
-void finally_within_finally() {
+void finally_within_finally(void) {
__try {
might_crash();
} __finally {
// CHECK-SAME: [[finally_attrs]]
void cleanup_with_func(const char *);
-void finally_with_func() {
+void finally_with_func(void) {
__try {
might_crash();
} __finally {
// __leave with __except
// Nothing in the __try block can trap, so __try.cont isn't created.
-int __leave_with___except_simple() {
+int __leave_with___except_simple(void) {
int myres = 0;
__try {
myres = 15;
// The "normal" case.
-int __leave_with___except() {
+int __leave_with___except(void) {
int myres = 0;
__try {
g();
// Nothing in the __try block can trap, so __finally.cont and friends aren't
// created.
-int __leave_with___finally_simple() {
+int __leave_with___finally_simple(void) {
int myres = 0;
__try {
myres = 15;
// CHECK-NEXT: call void @"?fin$0@0@__leave_with___finally_simple@@"(i8 noundef 0, i8* noundef %[[fp]])
// __finally block doesn't return, __finally.cont doesn't exist.
-int __leave_with___finally_noreturn() {
+int __leave_with___finally_noreturn(void) {
int myres = 0;
__try {
myres = 15;
// CHECK-NEXT: call void @"?fin$0@0@__leave_with___finally_noreturn@@"(i8 noundef 0, i8* noundef %[[fp]])
// The "normal" case.
-int __leave_with___finally() {
+int __leave_with___finally(void) {
int myres = 0;
__try {
g();
//////////////////////////////////////////////////////////////////////////////
// Mixed, nested cases.
-int nested___except___finally() {
+int nested___except___finally(void) {
int myres = 0;
__try {
__try {
// CHECK: call void @g()
// CHECK: unreachable
-int nested___except___except() {
+int nested___except___except(void) {
int myres = 0;
__try {
__try {
// CHECK: [[tryleave]]
// CHECK-NEXT: br label %[[trycont4]]
-int nested___finally___except() {
+int nested___finally___except(void) {
int myres = 0;
__try {
__try {
// CHECK-LABEL: define internal void @"?fin$0@0@nested___finally___except@@"(i8 noundef %abnormal_termination, i8* noundef %frame_pointer)
// CHECK: ret void
-int nested___finally___finally() {
+int nested___finally___finally(void) {
int myres = 0;
__try {
__try {
// CHECK-LABEL: define internal void @"?fin$0@0@main@@"({{i8 noundef( zeroext)?}} %abnormal_termination, i8* noundef %frame_pointer)
// CHECK: call void @"?fin$1@0@main@@"({{i8 noundef( zeroext)?}} 0, i8* noundef %frame_pointer)
int
-main() {
+main(void) {
int Check = 0;
__try {
Check = 3;
// function definitions).
// rdar://problem/8621849
-void test1() {
+void test1(void) {
extern void test1_helper(void (^)(int));
// CHECK: define{{.*}} arm_aapcscc void @test1() [[STRICTFP0:#[0-9]+]] personality i8* bitcast (i32 (...)* @__gcc_personality_sj0 to i8*)
}
void test2_helper();
-void test2() {
+void test2(void) {
// CHECK: define{{.*}} arm_aapcscc void @test2() [[STRICTFP0]] personality i8* bitcast (i32 (...)* @__gcc_personality_sj0 to i8*) {
__block int x = 10;
^{ (void)x; };
// RUN: %clang_cc1 -triple armv7-apple-unknown -emit-llvm -o - %s -fexceptions -exception-model=sjlj -fblocks | FileCheck %s -check-prefix=CHECK-ARM
// rdar://problem/8621849
-void test1() {
+void test1(void) {
extern void test1_helper(void (^)(int));
// CHECK-LABEL: define{{.*}} void @test1() {{.*}} personality i8* bitcast (i32 (...)* @__gcc_personality_v0 to i8*)
}
void test2_helper();
-void test2() {
+void test2(void) {
__block int x = 10;
^{ (void)x; };
test2_helper(5, 6, 7);
#pragma float_control(except, on)
-void eMaisUma() {
+void eMaisUma(void) {
double t[1];
if (*t)
return;
}
_Bool test2b;
-int test2() { if (test2b); return 0; }
+int test2(void) { if (test2b); return 0; }
// PR1921
-int test3() {
+int test3(void) {
const unsigned char *bp;
bp -= (short)1;
}
// PR2080 - sizeof void
int t1 = sizeof(void);
int t2 = __alignof__(void);
-void test4() {
+void test4(void) {
t1 = sizeof(void);
t2 = __alignof__(void);
}
// this one shouldn't fold
-int ola() {
+int ola(void) {
int a=2;
if ((0, (int)a) & 2) { return 1; }
return 2;
}
// this one shouldn't fold as well
-void eMaisUma() {
+void eMaisUma(void) {
double t[1];
if (*t)
return;
int Y;
};
struct X foo();
-int bar() {
+int bar(void) {
return ((struct X)foo()).Y + 1;
}
}
union f3_x {int x; float y;};
-int f3() {return ((union f3_x)2).x;}
+int f3(void) {return ((union f3_x)2).x;}
union f4_y {int x; _Complex float y;};
-_Complex float f4() {return ((union f4_y)(_Complex float)2.0).y;}
+_Complex float f4(void) {return ((union f4_y)(_Complex float)2.0).y;}
struct f5_a { int a; } f5_a;
union f5_z {int x; struct f5_a y;};
-struct f5_a f5() {return ((union f5_z)f5_a).y;}
+struct f5_a f5(void) {return ((union f5_z)f5_a).y;}
// ?: in "lvalue"
struct s6 { int f0; };
}
// PR4026
-void f7() {
+void f7(void) {
__func__;
}
// PR4067
-int f8() {
+int f8(void) {
return ({ foo(); }).Y;
}
foo(((void)1, x->c).tab[0]);
}
-void f10() {
+void f10(void) {
__builtin_sin(0);
}
// CHECK-NEXT: load i32, i32* [[T0]], align 4
}
-int f12() {
+int f12(void) {
// PR3150
// CHECK-LABEL: define{{.*}} i32 @f12
// CHECK: ret i32 1
}
// CHECK-LABEL: define{{.*}} void @f15
-void f15() {
+void f15(void) {
extern void f15_start(void);
f15_start();
// CHECK: call void @f15_start()
// PR8967: this was crashing
// CHECK-LABEL: define{{.*}} void @f16()
-void f16() {
+void f16(void) {
__extension__({ goto lbl; });
lbl:
;
// PR13704: negative increment in i128 is not preserved.
// CHECK-LABEL: define{{.*}} void @f17()
-void f17() {
+void f17(void) {
extern void extfunc(__int128);
__int128 x = 2;
x--;
int i;
} strct;
int returns_int(void);
-void f18() {
+void f18(void) {
(strct)returns_int();
}
// CHECK-LABEL: define{{.*}} void @f18()
// CHECK: call i32 @returns_int()
// Ensure the right stmt is returned
-int f19() {
+int f19(void) {
return ({ 3;;4;; });
}
// CHECK-LABEL: define{{.*}} i32 @f19()
// ARM-NOT: define{{.*}} arm_aapcscc void @ParamPassing4(i129* byval(i129) align 8 %{{.+}})
#endif
-_BitInt(63) ReturnPassing(){}
+_BitInt(63) ReturnPassing(void){}
// LIN64: define{{.*}} i64 @ReturnPassing(
// WIN64: define dso_local i63 @ReturnPassing(
// LIN32: define{{.*}} i63 @ReturnPassing(
// AARCH64DARWIN: define{{.*}} i63 @ReturnPassing(
// ARM: define{{.*}} arm_aapcscc i63 @ReturnPassing(
-_BitInt(64) ReturnPassing2(){}
+_BitInt(64) ReturnPassing2(void){}
// LIN64: define{{.*}} i64 @ReturnPassing2(
// WIN64: define dso_local i64 @ReturnPassing2(
// LIN32: define{{.*}} i64 @ReturnPassing2(
// AARCH64DARWIN: define{{.*}} i64 @ReturnPassing2(
// ARM: define{{.*}} arm_aapcscc i64 @ReturnPassing2(
-_BitInt(127) ReturnPassing3(){}
+_BitInt(127) ReturnPassing3(void){}
// LIN64: define{{.*}} { i64, i64 } @ReturnPassing3(
// WIN64: define dso_local void @ReturnPassing3(i127* noalias sret
// LIN32: define{{.*}} void @ReturnPassing3(i127* noalias sret
// AARCH64DARWIN: define{{.*}} i127 @ReturnPassing3(
// ARM: define{{.*}} arm_aapcscc void @ReturnPassing3(i127* noalias sret
-_BitInt(128) ReturnPassing4(){}
+_BitInt(128) ReturnPassing4(void){}
// LIN64: define{{.*}} { i64, i64 } @ReturnPassing4(
// WIN64: define dso_local void @ReturnPassing4(i128* noalias sret
// LIN32: define{{.*}} void @ReturnPassing4(i128* noalias sret
// ARM: define{{.*}} arm_aapcscc void @ReturnPassing4(i128* noalias sret
#if __BITINT_MAXWIDTH__ > 128
-_BitInt(129) ReturnPassing5(){}
+_BitInt(129) ReturnPassing5(void){}
// LIN64-NOT: define{{.*}} void @ReturnPassing5(i129* noalias sret
// WIN64-NOT: define dso_local void @ReturnPassing5(i129* noalias sret
// LIN32-NOT: define{{.*}} void @ReturnPassing5(i129* noalias sret
// SparcV9 is odd in that it has a return-size limit of 256, not 128 or 64
// like other platforms, so test to make sure this behavior will still work.
-_BitInt(256) ReturnPassing6() {}
+_BitInt(256) ReturnPassing6(void) {}
// SPARCV9-NOT: define{{.*}} i256 @ReturnPassing6(
-_BitInt(257) ReturnPassing7() {}
+_BitInt(257) ReturnPassing7(void) {}
// SPARCV9-NOT: define{{.*}} void @ReturnPassing7(i257* noalias sret
#endif
_BitInt(17) C;
};
-void OffsetOfTest() {
+void OffsetOfTest(void) {
// CHECK: define {{.*}}void @OffsetOfTest
int A = __builtin_offsetof(struct S,A);
// CHECK: store i32 0, i32* %{{.+}}
typedef __attribute__(( ext_vector_type(4) )) float float4;
// CHECK: @test
-void test()
+void test(void)
{
float4 va;
va.hi[0] = 3.0;
// CHECK: shufflevector {{.*}} <i32 1, i32 1, i32 1, i32 1>
// CHECK: insertelement
// CHECK: shufflevector {{.*}} <i32 1, i32 0>
-void test2() {
+void test2(void) {
vec2 = vec4.xy; // shorten
f = vec2.x; // extract elt
vec4 = vec4.yyyy; // splat
// CHECK: @test11
// CHECK: extractelement <4 x i32>
-int4 test11a();
-int test11() {
+int4 test11a(void);
+int test11(void) {
return test11a().x;
}
float16 vec16, vec16_2;
// CHECK: @test_rgba
-void test_rgba() {
+void test_rgba(void) {
// CHECK: fadd <4 x float>
vec4_2 = vec4.abgr + vec4;
__int128 i128;
#endif
-int test() {
+int test(void) {
// CHECK: define{{.*}} i32 @test{{.*}}
// CHECKEXT: [[TAG_u32:%.*]] = load i32, i32* @u32{{.*}}
// RUN: %clang_cc1 %s -emit-llvm -o %t
-int f() {
+int f(void) {
extern int a;
return a;
}
#if !defined(__linux__) && !defined(__FreeBSD__) && \
!defined(__OpenBSD__) && !defined(__CYGWIN__) && !defined(__DragonFly__)
-void foo() __attribute__((weak_import));
+void foo(void) __attribute__((weak_import));
#else
-void foo() __attribute__((weak));
+void foo(void) __attribute__((weak));
#endif
-void bar() { foo(); }
+void bar(void) { foo(); }
// RUN: %clang_cc1 -triple x86_64-windows-msvc -fms-extensions -emit-llvm -o - %s | FileCheck %s
-__declspec(dllimport) void f();
-void g() { f(); } // use it
+__declspec(dllimport) void f(void);
+void g(void) { f(); } // use it
// CHECK: define dso_local dllexport void @f
-void f() { }
+void f(void) { }
// RUN: %clang_cc1 -triple i686-win32 -emit-llvm -fms-extensions < %s | FileCheck %s
-void bar() {
+void bar(void) {
}
// CHECK-NOT: foo
-__forceinline void foo() {
+__forceinline void foo(void) {
bar();
}
-void i_want_bar() {
+void i_want_bar(void) {
// CHECK: call void @bar
foo();
}
\r
float f0, f1, f2;\r
\r
-void foo() {\r
+void foo(void) {\r
// CHECK-LABEL: define {{.*}}void @foo()\r
\r
// MAYTRAP: llvm.experimental.constrained.fadd.f32(float %{{.*}}, float %{{.*}}, metadata !"round.tonearest", metadata !"fpexcept.maytrap")\r
// RUN: %clang_cc1 -triple x86_64-apple-darwin %s -emit-llvm -o - | FileCheck %s
// rdar://7270273
-void foo() __attribute__((aligned (64)));
-void foo() {
+void foo(void) __attribute__((aligned (64)));
+void foo(void) {
// CHECK: define{{.*}} void @foo() {{.*}} align 64
}
extern void PRINTF(const char *);
extern void B(void (^)(void));
-int main()
+int main(void)
{
PRINTF(__func__);
B(
int q_sk_num(void *a);
typedef int (*fptr)(double);
-void a() { ((fptr)q_sk_num)(0); }
+void a(void) { ((fptr)q_sk_num)(0); }
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm -o - %s | FileCheck %s
-void __attribute((__min_vector_width__(128))) foo() {}
+void __attribute((__min_vector_width__(128))) foo(void) {}
// CHECK: "min-legal-vector-width"="128"
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O2 -x ir %t.o -fthinlto-index=%t.thinlto.bc -S -fdata-sections -o - | FileCheck %s --check-prefix=DATA_SECT
const int hello = 123;
-void world() {}
+void world(void) {}
// PLAIN-NOT: section
// PLAIN: world:
// RUN: %clang_cc1 -triple arm-unknown-unknown -emit-llvm -o - %s -target-feature +soft-float | FileCheck %s -check-prefix=SOFT-FLOAT
// RUN: %clang_cc1 -triple mips-unknown-unknown -emit-llvm -o - %s -target-feature +soft-float | FileCheck %s -check-prefix=SOFT-FLOAT
-void foo() {}
+void foo(void) {}
// AVX-FEATURE: "target-features"{{.*}}+avx
// AVX-NO-CPU-NOT: target-cpu
// RUN: %clang_cc1 -triple x86_64-pc-linux -S -ffunction-sections -fdata-sections -o - < %s | FileCheck %s --check-prefix=UNIQUE
const int hello = 123;
-void world() {}
+void world(void) {}
// CHECK: .section .text,"ax",@progbits,unique
// CHECK: .section .rodata,"a",@progbits,unique
int __attribute__((weak)) g1_def (void) { return 0; }
// Force _ext references
-void f0() {
+void f0(void) {
int a = g0_ext;
int b = g1_ext();
}
extern int x[];
-void foo() { x[0] = 1; }
+void foo(void) { x[0] = 1; }
int x[10];
-void bar() { x[0] = 1; }
+void bar(void) { x[0] = 1; }
extern int y[];
_Bool booltest = 0;
-void booltest2() {
+void booltest2(void) {
static _Bool booltest3 = 4;
}
// RUN: %clang_cc1 -triple %ms_abi_triple -fms-extensions -emit-llvm -O2 -o - %s | FileCheck %s
-void target_func();
-void (*func_ptr)() = &target_func;
+void target_func(void);
+void (*func_ptr)(void) = &target_func;
// The "guard_nocf" attribute must be added.
-__declspec(guard(nocf)) void nocf0() {
+__declspec(guard(nocf)) void nocf0(void) {
(*func_ptr)();
}
// CHECK-LABEL: nocf0
// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
// The "guard_nocf" attribute must *not* be added.
-void cf0() {
+void cf0(void) {
(*func_ptr)();
}
// CHECK-LABEL: cf0
// If the modifier is present on either the function declaration or definition,
// the "guard_nocf" attribute must be added.
-__declspec(guard(nocf)) void nocf1();
-void nocf1() {
+__declspec(guard(nocf)) void nocf1(void);
+void nocf1(void) {
(*func_ptr)();
}
// CHECK-LABEL: nocf1
// CHECK: call{{.*}}[[NOCF:#[0-9]+]]
-void nocf2();
-__declspec(guard(nocf)) void nocf2() {
+void nocf2(void);
+__declspec(guard(nocf)) void nocf2(void) {
(*func_ptr)();
}
// CHECK-LABEL: nocf2
// When inlining a function, the "guard_nocf" attribute on indirect calls must
// be preserved.
-void nocf3() {
+void nocf3(void) {
nocf0();
}
// CHECK-LABEL: nocf3
// When inlining into a function marked as __declspec(guard(nocf)), the
// "guard_nocf" attribute must *not* be added to the inlined calls.
-__declspec(guard(nocf)) void cf1() {
+__declspec(guard(nocf)) void cf1(void) {
cf0();
}
// CHECK-LABEL: cf1
// RUN: %clang_cc1 -triple hexagon-unknown-elf -target-feature +hvx -target-feature +hvx-length128b -emit-llvm -o - %s | FileCheck %s
-void test_r0() {
+void test_r0(void) {
// CHECK: define {{.*}}void @test_r0
// CHECK: call void asm sideeffect "nop", "~{r0}"()
asm("nop" ::: "r0");
}
-void test_r1() {
+void test_r1(void) {
// CHECK: define {{.*}}void @test_r1
// CHECK: call void asm sideeffect "nop", "~{r1}"()
asm("nop" ::: "r1");
}
-void test_r2() {
+void test_r2(void) {
// CHECK: define {{.*}}void @test_r2
// CHECK: call void asm sideeffect "nop", "~{r2}"()
asm("nop" ::: "r2");
}
-void test_r3() {
+void test_r3(void) {
// CHECK: define {{.*}}void @test_r3
// CHECK: call void asm sideeffect "nop", "~{r3}"()
asm("nop" ::: "r3");
}
-void test_r4() {
+void test_r4(void) {
// CHECK: define {{.*}}void @test_r4
// CHECK: call void asm sideeffect "nop", "~{r4}"()
asm("nop" ::: "r4");
}
-void test_r5() {
+void test_r5(void) {
// CHECK: define {{.*}}void @test_r5
// CHECK: call void asm sideeffect "nop", "~{r5}"()
asm("nop" ::: "r5");
}
-void test_r6() {
+void test_r6(void) {
// CHECK: define {{.*}}void @test_r6
// CHECK: call void asm sideeffect "nop", "~{r6}"()
asm("nop" ::: "r6");
}
-void test_r7() {
+void test_r7(void) {
// CHECK: define {{.*}}void @test_r7
// CHECK: call void asm sideeffect "nop", "~{r7}"()
asm("nop" ::: "r7");
}
-void test_r8() {
+void test_r8(void) {
// CHECK: define {{.*}}void @test_r8
// CHECK: call void asm sideeffect "nop", "~{r8}"()
asm("nop" ::: "r8");
}
-void test_r9() {
+void test_r9(void) {
// CHECK: define {{.*}}void @test_r9
// CHECK: call void asm sideeffect "nop", "~{r9}"()
asm("nop" ::: "r9");
}
-void test_r10() {
+void test_r10(void) {
// CHECK: define {{.*}}void @test_r10
// CHECK: call void asm sideeffect "nop", "~{r10}"()
asm("nop" ::: "r10");
}
-void test_r11() {
+void test_r11(void) {
// CHECK: define {{.*}}void @test_r11
// CHECK: call void asm sideeffect "nop", "~{r11}"()
asm("nop" ::: "r11");
}
-void test_r12() {
+void test_r12(void) {
// CHECK: define {{.*}}void @test_r12
// CHECK: call void asm sideeffect "nop", "~{r12}"()
asm("nop" ::: "r12");
}
-void test_r13() {
+void test_r13(void) {
// CHECK: define {{.*}}void @test_r13
// CHECK: call void asm sideeffect "nop", "~{r13}"()
asm("nop" ::: "r13");
}
-void test_r14() {
+void test_r14(void) {
// CHECK: define {{.*}}void @test_r14
// CHECK: call void asm sideeffect "nop", "~{r14}"()
asm("nop" ::: "r14");
}
-void test_r15() {
+void test_r15(void) {
// CHECK: define {{.*}}void @test_r15
// CHECK: call void asm sideeffect "nop", "~{r15}"()
asm("nop" ::: "r15");
}
-void test_r16() {
+void test_r16(void) {
// CHECK: define {{.*}}void @test_r16
// CHECK: call void asm sideeffect "nop", "~{r16}"()
asm("nop" ::: "r16");
}
-void test_r17() {
+void test_r17(void) {
// CHECK: define {{.*}}void @test_r17
// CHECK: call void asm sideeffect "nop", "~{r17}"()
asm("nop" ::: "r17");
}
-void test_r18() {
+void test_r18(void) {
// CHECK: define {{.*}}void @test_r18
// CHECK: call void asm sideeffect "nop", "~{r18}"()
asm("nop" ::: "r18");
}
-void test_r19() {
+void test_r19(void) {
// CHECK: define {{.*}}void @test_r19
// CHECK: call void asm sideeffect "nop", "~{r19}"()
asm("nop" ::: "r19");
}
-void test_r20() {
+void test_r20(void) {
// CHECK: define {{.*}}void @test_r20
// CHECK: call void asm sideeffect "nop", "~{r20}"()
asm("nop" ::: "r20");
}
-void test_r21() {
+void test_r21(void) {
// CHECK: define {{.*}}void @test_r21
// CHECK: call void asm sideeffect "nop", "~{r21}"()
asm("nop" ::: "r21");
}
-void test_r22() {
+void test_r22(void) {
// CHECK: define {{.*}}void @test_r22
// CHECK: call void asm sideeffect "nop", "~{r22}"()
asm("nop" ::: "r22");
}
-void test_r23() {
+void test_r23(void) {
// CHECK: define {{.*}}void @test_r23
// CHECK: call void asm sideeffect "nop", "~{r23}"()
asm("nop" ::: "r23");
}
-void test_r24() {
+void test_r24(void) {
// CHECK: define {{.*}}void @test_r24
// CHECK: call void asm sideeffect "nop", "~{r24}"()
asm("nop" ::: "r24");
}
-void test_r25() {
+void test_r25(void) {
// CHECK: define {{.*}}void @test_r25
// CHECK: call void asm sideeffect "nop", "~{r25}"()
asm("nop" ::: "r25");
}
-void test_r26() {
+void test_r26(void) {
// CHECK: define {{.*}}void @test_r26
// CHECK: call void asm sideeffect "nop", "~{r26}"()
asm("nop" ::: "r26");
}
-void test_r27() {
+void test_r27(void) {
// CHECK: define {{.*}}void @test_r27
// CHECK: call void asm sideeffect "nop", "~{r27}"()
asm("nop" ::: "r27");
}
-void test_r28() {
+void test_r28(void) {
// CHECK: define {{.*}}void @test_r28
// CHECK: call void asm sideeffect "nop", "~{r28}"()
asm("nop" ::: "r28");
}
-void test_r29() {
+void test_r29(void) {
// CHECK: define {{.*}}void @test_r29
// CHECK: call void asm sideeffect "nop", "~{r29}"()
asm("nop" ::: "r29");
}
-void test_r30() {
+void test_r30(void) {
// CHECK: define {{.*}}void @test_r30
// CHECK: call void asm sideeffect "nop", "~{r30}"()
asm("nop" ::: "r30");
}
-void test_r31() {
+void test_r31(void) {
// CHECK: define {{.*}}void @test_r31
// CHECK: call void asm sideeffect "nop", "~{r31}"()
asm("nop" ::: "r31");
}
-void test_r1_0() {
+void test_r1_0(void) {
// CHECK: define {{.*}}void @test_r1_0
// CHECK: call void asm sideeffect "nop", "~{r1:0}"()
asm("nop" ::: "r1:0");
}
-void test_r3_2() {
+void test_r3_2(void) {
// CHECK: define {{.*}}void @test_r3_2
// CHECK: call void asm sideeffect "nop", "~{r3:2}"()
asm("nop" ::: "r3:2");
}
-void test_r5_4() {
+void test_r5_4(void) {
// CHECK: define {{.*}}void @test_r5_4
// CHECK: call void asm sideeffect "nop", "~{r5:4}"()
asm("nop" ::: "r5:4");
}
-void test_r7_6() {
+void test_r7_6(void) {
// CHECK: define {{.*}}void @test_r7_6
// CHECK: call void asm sideeffect "nop", "~{r7:6}"()
asm("nop" ::: "r7:6");
}
-void test_r9_8() {
+void test_r9_8(void) {
// CHECK: define {{.*}}void @test_r9_8
// CHECK: call void asm sideeffect "nop", "~{r9:8}"()
asm("nop" ::: "r9:8");
}
-void test_r11_10() {
+void test_r11_10(void) {
// CHECK: define {{.*}}void @test_r11_10
// CHECK: call void asm sideeffect "nop", "~{r11:10}"()
asm("nop" ::: "r11:10");
}
-void test_r13_12() {
+void test_r13_12(void) {
// CHECK: define {{.*}}void @test_r13_12
// CHECK: call void asm sideeffect "nop", "~{r13:12}"()
asm("nop" ::: "r13:12");
}
-void test_r15_14() {
+void test_r15_14(void) {
// CHECK: define {{.*}}void @test_r15_14
// CHECK: call void asm sideeffect "nop", "~{r15:14}"()
asm("nop" ::: "r15:14");
}
-void test_r17_16() {
+void test_r17_16(void) {
// CHECK: define {{.*}}void @test_r17_16
// CHECK: call void asm sideeffect "nop", "~{r17:16}"()
asm("nop" ::: "r17:16");
}
-void test_r19_18() {
+void test_r19_18(void) {
// CHECK: define {{.*}}void @test_r19_18
// CHECK: call void asm sideeffect "nop", "~{r19:18}"()
asm("nop" ::: "r19:18");
}
-void test_r21_20() {
+void test_r21_20(void) {
// CHECK: define {{.*}}void @test_r21_20
// CHECK: call void asm sideeffect "nop", "~{r21:20}"()
asm("nop" ::: "r21:20");
}
-void test_r23_22() {
+void test_r23_22(void) {
// CHECK: define {{.*}}void @test_r23_22
// CHECK: call void asm sideeffect "nop", "~{r23:22}"()
asm("nop" ::: "r23:22");
}
-void test_r25_24() {
+void test_r25_24(void) {
// CHECK: define {{.*}}void @test_r25_24
// CHECK: call void asm sideeffect "nop", "~{r25:24}"()
asm("nop" ::: "r25:24");
}
-void test_r27_26() {
+void test_r27_26(void) {
// CHECK: define {{.*}}void @test_r27_26
// CHECK: call void asm sideeffect "nop", "~{r27:26}"()
asm("nop" ::: "r27:26");
}
-void test_r29_28() {
+void test_r29_28(void) {
// CHECK: define {{.*}}void @test_r29_28
// CHECK: call void asm sideeffect "nop", "~{r29:28}"()
asm("nop" ::: "r29:28");
}
-void test_r31_30() {
+void test_r31_30(void) {
// CHECK: define {{.*}}void @test_r31_30
// CHECK: call void asm sideeffect "nop", "~{r31:30}"()
asm("nop" ::: "r31:30");
}
-void test_p0() {
+void test_p0(void) {
// CHECK: define {{.*}}void @test_p0
// CHECK: call void asm sideeffect "nop", "~{p0}"()
asm("nop" ::: "p0");
}
-void test_p1() {
+void test_p1(void) {
// CHECK: define {{.*}}void @test_p1
// CHECK: call void asm sideeffect "nop", "~{p1}"()
asm("nop" ::: "p1");
}
-void test_p2() {
+void test_p2(void) {
// CHECK: define {{.*}}void @test_p2
// CHECK: call void asm sideeffect "nop", "~{p2}"()
asm("nop" ::: "p2");
}
-void test_p3() {
+void test_p3(void) {
// CHECK: define {{.*}}void @test_p3
// CHECK: call void asm sideeffect "nop", "~{p3}"()
asm("nop" ::: "p3");
}
-void test_c0() {
+void test_c0(void) {
// CHECK: define {{.*}}void @test_c0
// CHECK: call void asm sideeffect "nop", "~{c0}"()
asm("nop" ::: "c0");
}
-void test_c1() {
+void test_c1(void) {
// CHECK: define {{.*}}void @test_c1
// CHECK: call void asm sideeffect "nop", "~{c1}"()
asm("nop" ::: "c1");
}
-void test_c2() {
+void test_c2(void) {
// CHECK: define {{.*}}void @test_c2
// CHECK: call void asm sideeffect "nop", "~{c2}"()
asm("nop" ::: "c2");
}
-void test_c3() {
+void test_c3(void) {
// CHECK: define {{.*}}void @test_c3
// CHECK: call void asm sideeffect "nop", "~{c3}"()
asm("nop" ::: "c3");
}
-void test_c4() {
+void test_c4(void) {
// CHECK: define {{.*}}void @test_c4
// CHECK: call void asm sideeffect "nop", "~{c4}"()
asm("nop" ::: "c4");
}
-void test_c5() {
+void test_c5(void) {
// CHECK: define {{.*}}void @test_c5
// CHECK: call void asm sideeffect "nop", "~{c5}"()
asm("nop" ::: "c5");
}
-void test_c6() {
+void test_c6(void) {
// CHECK: define {{.*}}void @test_c6
// CHECK: call void asm sideeffect "nop", "~{c6}"()
asm("nop" ::: "c6");
}
-void test_c7() {
+void test_c7(void) {
// CHECK: define {{.*}}void @test_c7
// CHECK: call void asm sideeffect "nop", "~{c7}"()
asm("nop" ::: "c7");
}
-void test_c8() {
+void test_c8(void) {
// CHECK: define {{.*}}void @test_c8
// CHECK: call void asm sideeffect "nop", "~{c8}"()
asm("nop" ::: "c8");
}
-void test_c9() {
+void test_c9(void) {
// CHECK: define {{.*}}void @test_c9
// CHECK: call void asm sideeffect "nop", "~{c9}"()
asm("nop" ::: "c9");
}
-void test_c10() {
+void test_c10(void) {
// CHECK: define {{.*}}void @test_c10
// CHECK: call void asm sideeffect "nop", "~{c10}"()
asm("nop" ::: "c10");
}
-void test_c11() {
+void test_c11(void) {
// CHECK: define {{.*}}void @test_c11
// CHECK: call void asm sideeffect "nop", "~{c11}"()
asm("nop" ::: "c11");
}
-void test_c12() {
+void test_c12(void) {
// CHECK: define {{.*}}void @test_c12
// CHECK: call void asm sideeffect "nop", "~{c12}"()
asm("nop" ::: "c12");
}
-void test_c13() {
+void test_c13(void) {
// CHECK: define {{.*}}void @test_c13
// CHECK: call void asm sideeffect "nop", "~{c13}"()
asm("nop" ::: "c13");
}
-void test_c14() {
+void test_c14(void) {
// CHECK: define {{.*}}void @test_c14
// CHECK: call void asm sideeffect "nop", "~{c14}"()
asm("nop" ::: "c14");
}
-void test_c15() {
+void test_c15(void) {
// CHECK: define {{.*}}void @test_c15
// CHECK: call void asm sideeffect "nop", "~{c15}"()
asm("nop" ::: "c15");
}
-void test_c16() {
+void test_c16(void) {
// CHECK: define {{.*}}void @test_c16
// CHECK: call void asm sideeffect "nop", "~{c16}"()
asm("nop" ::: "c16");
}
-void test_c17() {
+void test_c17(void) {
// CHECK: define {{.*}}void @test_c17
// CHECK: call void asm sideeffect "nop", "~{c17}"()
asm("nop" ::: "c17");
}
-void test_c18() {
+void test_c18(void) {
// CHECK: define {{.*}}void @test_c18
// CHECK: call void asm sideeffect "nop", "~{c18}"()
asm("nop" ::: "c18");
}
-void test_c19() {
+void test_c19(void) {
// CHECK: define {{.*}}void @test_c19
// CHECK: call void asm sideeffect "nop", "~{c19}"()
asm("nop" ::: "c19");
}
-void test_c20() {
+void test_c20(void) {
// CHECK: define {{.*}}void @test_c20
// CHECK: call void asm sideeffect "nop", "~{c20}"()
asm("nop" ::: "c20");
}
-void test_c21() {
+void test_c21(void) {
// CHECK: define {{.*}}void @test_c21
// CHECK: call void asm sideeffect "nop", "~{c21}"()
asm("nop" ::: "c21");
}
-void test_c22() {
+void test_c22(void) {
// CHECK: define {{.*}}void @test_c22
// CHECK: call void asm sideeffect "nop", "~{c22}"()
asm("nop" ::: "c22");
}
-void test_c23() {
+void test_c23(void) {
// CHECK: define {{.*}}void @test_c23
// CHECK: call void asm sideeffect "nop", "~{c23}"()
asm("nop" ::: "c23");
}
-void test_c24() {
+void test_c24(void) {
// CHECK: define {{.*}}void @test_c24
// CHECK: call void asm sideeffect "nop", "~{c24}"()
asm("nop" ::: "c24");
}
-void test_c25() {
+void test_c25(void) {
// CHECK: define {{.*}}void @test_c25
// CHECK: call void asm sideeffect "nop", "~{c25}"()
asm("nop" ::: "c25");
}
-void test_c26() {
+void test_c26(void) {
// CHECK: define {{.*}}void @test_c26
// CHECK: call void asm sideeffect "nop", "~{c26}"()
asm("nop" ::: "c26");
}
-void test_c27() {
+void test_c27(void) {
// CHECK: define {{.*}}void @test_c27
// CHECK: call void asm sideeffect "nop", "~{c27}"()
asm("nop" ::: "c27");
}
-void test_c28() {
+void test_c28(void) {
// CHECK: define {{.*}}void @test_c28
// CHECK: call void asm sideeffect "nop", "~{c28}"()
asm("nop" ::: "c28");
}
-void test_c29() {
+void test_c29(void) {
// CHECK: define {{.*}}void @test_c29
// CHECK: call void asm sideeffect "nop", "~{c29}"()
asm("nop" ::: "c29");
}
-void test_c30() {
+void test_c30(void) {
// CHECK: define {{.*}}void @test_c30
// CHECK: call void asm sideeffect "nop", "~{c30}"()
asm("nop" ::: "c30");
}
-void test_c31() {
+void test_c31(void) {
// CHECK: define {{.*}}void @test_c31
// CHECK: call void asm sideeffect "nop", "~{c31}"()
asm("nop" ::: "c31");
}
-void test_c1_0() {
+void test_c1_0(void) {
// CHECK: define {{.*}}void @test_c1_0
// CHECK: call void asm sideeffect "nop", "~{c1:0}"()
asm("nop" ::: "c1:0");
}
-void test_c3_2() {
+void test_c3_2(void) {
// CHECK: define {{.*}}void @test_c3_2
// CHECK: call void asm sideeffect "nop", "~{c3:2}"()
asm("nop" ::: "c3:2");
}
-void test_c5_4() {
+void test_c5_4(void) {
// CHECK: define {{.*}}void @test_c5_4
// CHECK: call void asm sideeffect "nop", "~{c5:4}"()
asm("nop" ::: "c5:4");
}
-void test_c7_6() {
+void test_c7_6(void) {
// CHECK: define {{.*}}void @test_c7_6
// CHECK: call void asm sideeffect "nop", "~{c7:6}"()
asm("nop" ::: "c7:6");
}
-void test_c9_8() {
+void test_c9_8(void) {
// CHECK: define {{.*}}void @test_c9_8
// CHECK: call void asm sideeffect "nop", "~{c9:8}"()
asm("nop" ::: "c9:8");
}
-void test_c11_10() {
+void test_c11_10(void) {
// CHECK: define {{.*}}void @test_c11_10
// CHECK: call void asm sideeffect "nop", "~{c11:10}"()
asm("nop" ::: "c11:10");
}
-void test_c13_12() {
+void test_c13_12(void) {
// CHECK: define {{.*}}void @test_c13_12
// CHECK: call void asm sideeffect "nop", "~{c13:12}"()
asm("nop" ::: "c13:12");
}
-void test_c15_14() {
+void test_c15_14(void) {
// CHECK: define {{.*}}void @test_c15_14
// CHECK: call void asm sideeffect "nop", "~{c15:14}"()
asm("nop" ::: "c15:14");
}
-void test_c17_16() {
+void test_c17_16(void) {
// CHECK: define {{.*}}void @test_c17_16
// CHECK: call void asm sideeffect "nop", "~{c17:16}"()
asm("nop" ::: "c17:16");
}
-void test_c19_18() {
+void test_c19_18(void) {
// CHECK: define {{.*}}void @test_c19_18
// CHECK: call void asm sideeffect "nop", "~{c19:18}"()
asm("nop" ::: "c19:18");
}
-void test_c21_20() {
+void test_c21_20(void) {
// CHECK: define {{.*}}void @test_c21_20
// CHECK: call void asm sideeffect "nop", "~{c21:20}"()
asm("nop" ::: "c21:20");
}
-void test_c23_22() {
+void test_c23_22(void) {
// CHECK: define {{.*}}void @test_c23_22
// CHECK: call void asm sideeffect "nop", "~{c23:22}"()
asm("nop" ::: "c23:22");
}
-void test_c25_24() {
+void test_c25_24(void) {
// CHECK: define {{.*}}void @test_c25_24
// CHECK: call void asm sideeffect "nop", "~{c25:24}"()
asm("nop" ::: "c25:24");
}
-void test_c27_26() {
+void test_c27_26(void) {
// CHECK: define {{.*}}void @test_c27_26
// CHECK: call void asm sideeffect "nop", "~{c27:26}"()
asm("nop" ::: "c27:26");
}
-void test_c29_28() {
+void test_c29_28(void) {
// CHECK: define {{.*}}void @test_c29_28
// CHECK: call void asm sideeffect "nop", "~{c29:28}"()
asm("nop" ::: "c29:28");
}
-void test_c31_30() {
+void test_c31_30(void) {
// CHECK: define {{.*}}void @test_c31_30
// CHECK: call void asm sideeffect "nop", "~{c31:30}"()
asm("nop" ::: "c31:30");
}
-void test_sa0() {
+void test_sa0(void) {
// CHECK: define {{.*}}void @test_sa0
// CHECK: call void asm sideeffect "nop", "~{sa0}"()
asm("nop" ::: "sa0");
}
-void test_lc0() {
+void test_lc0(void) {
// CHECK: define {{.*}}void @test_lc0
// CHECK: call void asm sideeffect "nop", "~{lc0}"()
asm("nop" ::: "lc0");
}
-void test_sa1() {
+void test_sa1(void) {
// CHECK: define {{.*}}void @test_sa1
// CHECK: call void asm sideeffect "nop", "~{sa1}"()
asm("nop" ::: "sa1");
}
-void test_lc1() {
+void test_lc1(void) {
// CHECK: define {{.*}}void @test_lc1
// CHECK: call void asm sideeffect "nop", "~{lc1}"()
asm("nop" ::: "lc1");
}
-void test_p3_0() {
+void test_p3_0(void) {
// CHECK: define {{.*}}void @test_p3_0
// CHECK: call void asm sideeffect "nop", "~{p3:0}"()
asm("nop" ::: "p3:0");
}
-void test_m0() {
+void test_m0(void) {
// CHECK: define {{.*}}void @test_m0
// CHECK: call void asm sideeffect "nop", "~{m0}"()
asm("nop" ::: "m0");
}
-void test_m1() {
+void test_m1(void) {
// CHECK: define {{.*}}void @test_m1
// CHECK: call void asm sideeffect "nop", "~{m1}"()
asm("nop" ::: "m1");
}
-void test_usr() {
+void test_usr(void) {
// CHECK: define {{.*}}void @test_usr
// CHECK: call void asm sideeffect "nop", "~{usr}"()
asm("nop" ::: "usr");
}
-void test_pc() {
+void test_pc(void) {
// CHECK: define {{.*}}void @test_pc
// CHECK: call void asm sideeffect "nop", "~{pc}"()
asm("nop" ::: "pc");
}
-void test_ugp() {
+void test_ugp(void) {
// CHECK: define {{.*}}void @test_ugp
// CHECK: call void asm sideeffect "nop", "~{ugp}"()
asm("nop" ::: "ugp");
}
-void test_gp() {
+void test_gp(void) {
// CHECK: define {{.*}}void @test_gp
// CHECK: call void asm sideeffect "nop", "~{gp}"()
asm("nop" ::: "gp");
}
-void test_cs0() {
+void test_cs0(void) {
// CHECK: define {{.*}}void @test_cs0
// CHECK: call void asm sideeffect "nop", "~{cs0}"()
asm("nop" ::: "cs0");
}
-void test_cs1() {
+void test_cs1(void) {
// CHECK: define {{.*}}void @test_cs1
// CHECK: call void asm sideeffect "nop", "~{cs1}"()
asm("nop" ::: "cs1");
}
-void test_upcyclelo() {
+void test_upcyclelo(void) {
// CHECK: define {{.*}}void @test_upcyclelo
// CHECK: call void asm sideeffect "nop", "~{upcyclelo}"()
asm("nop" ::: "upcyclelo");
}
-void test_upcyclehi() {
+void test_upcyclehi(void) {
// CHECK: define {{.*}}void @test_upcyclehi
// CHECK: call void asm sideeffect "nop", "~{upcyclehi}"()
asm("nop" ::: "upcyclehi");
}
-void test_framelimit() {
+void test_framelimit(void) {
// CHECK: define {{.*}}void @test_framelimit
// CHECK: call void asm sideeffect "nop", "~{framelimit}"()
asm("nop" ::: "framelimit");
}
-void test_framekey() {
+void test_framekey(void) {
// CHECK: define {{.*}}void @test_framekey
// CHECK: call void asm sideeffect "nop", "~{framekey}"()
asm("nop" ::: "framekey");
}
-void test_pktcountlo() {
+void test_pktcountlo(void) {
// CHECK: define {{.*}}void @test_pktcountlo
// CHECK: call void asm sideeffect "nop", "~{pktcountlo}"()
asm("nop" ::: "pktcountlo");
}
-void test_pktcounthi() {
+void test_pktcounthi(void) {
// CHECK: define {{.*}}void @test_pktcounthi
// CHECK: call void asm sideeffect "nop", "~{pktcounthi}"()
asm("nop" ::: "pktcounthi");
}
-void test_utimerlo() {
+void test_utimerlo(void) {
// CHECK: define {{.*}}void @test_utimerlo
// CHECK: call void asm sideeffect "nop", "~{utimerlo}"()
asm("nop" ::: "utimerlo");
}
-void test_utimerhi() {
+void test_utimerhi(void) {
// CHECK: define {{.*}}void @test_utimerhi
// CHECK: call void asm sideeffect "nop", "~{utimerhi}"()
asm("nop" ::: "utimerhi");
}
-void test_upcycle() {
+void test_upcycle(void) {
// CHECK: define {{.*}}void @test_upcycle
// CHECK: call void asm sideeffect "nop", "~{upcycle}"()
asm("nop" ::: "upcycle");
}
-void test_pktcount() {
+void test_pktcount(void) {
// CHECK: define {{.*}}void @test_pktcount
// CHECK: call void asm sideeffect "nop", "~{pktcount}"()
asm("nop" ::: "pktcount");
}
-void test_utimer() {
+void test_utimer(void) {
// CHECK: define {{.*}}void @test_utimer
// CHECK: call void asm sideeffect "nop", "~{utimer}"()
asm("nop" ::: "utimer");
}
-void test_v0() {
+void test_v0(void) {
// CHECK: define {{.*}}void @test_v0
// CHECK: call void asm sideeffect "nop", "~{v0}"()
asm("nop" ::: "v0");
}
-void test_v1() {
+void test_v1(void) {
// CHECK: define {{.*}}void @test_v1
// CHECK: call void asm sideeffect "nop", "~{v1}"()
asm("nop" ::: "v1");
}
-void test_v2() {
+void test_v2(void) {
// CHECK: define {{.*}}void @test_v2
// CHECK: call void asm sideeffect "nop", "~{v2}"()
asm("nop" ::: "v2");
}
-void test_v3() {
+void test_v3(void) {
// CHECK: define {{.*}}void @test_v3
// CHECK: call void asm sideeffect "nop", "~{v3}"()
asm("nop" ::: "v3");
}
-void test_v4() {
+void test_v4(void) {
// CHECK: define {{.*}}void @test_v4
// CHECK: call void asm sideeffect "nop", "~{v4}"()
asm("nop" ::: "v4");
}
-void test_v5() {
+void test_v5(void) {
// CHECK: define {{.*}}void @test_v5
// CHECK: call void asm sideeffect "nop", "~{v5}"()
asm("nop" ::: "v5");
}
-void test_v6() {
+void test_v6(void) {
// CHECK: define {{.*}}void @test_v6
// CHECK: call void asm sideeffect "nop", "~{v6}"()
asm("nop" ::: "v6");
}
-void test_v7() {
+void test_v7(void) {
// CHECK: define {{.*}}void @test_v7
// CHECK: call void asm sideeffect "nop", "~{v7}"()
asm("nop" ::: "v7");
}
-void test_v8() {
+void test_v8(void) {
// CHECK: define {{.*}}void @test_v8
// CHECK: call void asm sideeffect "nop", "~{v8}"()
asm("nop" ::: "v8");
}
-void test_v9() {
+void test_v9(void) {
// CHECK: define {{.*}}void @test_v9
// CHECK: call void asm sideeffect "nop", "~{v9}"()
asm("nop" ::: "v9");
}
-void test_v10() {
+void test_v10(void) {
// CHECK: define {{.*}}void @test_v10
// CHECK: call void asm sideeffect "nop", "~{v10}"()
asm("nop" ::: "v10");
}
-void test_v11() {
+void test_v11(void) {
// CHECK: define {{.*}}void @test_v11
// CHECK: call void asm sideeffect "nop", "~{v11}"()
asm("nop" ::: "v11");
}
-void test_v12() {
+void test_v12(void) {
// CHECK: define {{.*}}void @test_v12
// CHECK: call void asm sideeffect "nop", "~{v12}"()
asm("nop" ::: "v12");
}
-void test_v13() {
+void test_v13(void) {
// CHECK: define {{.*}}void @test_v13
// CHECK: call void asm sideeffect "nop", "~{v13}"()
asm("nop" ::: "v13");
}
-void test_v14() {
+void test_v14(void) {
// CHECK: define {{.*}}void @test_v14
// CHECK: call void asm sideeffect "nop", "~{v14}"()
asm("nop" ::: "v14");
}
-void test_v15() {
+void test_v15(void) {
// CHECK: define {{.*}}void @test_v15
// CHECK: call void asm sideeffect "nop", "~{v15}"()
asm("nop" ::: "v15");
}
-void test_v16() {
+void test_v16(void) {
// CHECK: define {{.*}}void @test_v16
// CHECK: call void asm sideeffect "nop", "~{v16}"()
asm("nop" ::: "v16");
}
-void test_v17() {
+void test_v17(void) {
// CHECK: define {{.*}}void @test_v17
// CHECK: call void asm sideeffect "nop", "~{v17}"()
asm("nop" ::: "v17");
}
-void test_v18() {
+void test_v18(void) {
// CHECK: define {{.*}}void @test_v18
// CHECK: call void asm sideeffect "nop", "~{v18}"()
asm("nop" ::: "v18");
}
-void test_v19() {
+void test_v19(void) {
// CHECK: define {{.*}}void @test_v19
// CHECK: call void asm sideeffect "nop", "~{v19}"()
asm("nop" ::: "v19");
}
-void test_v20() {
+void test_v20(void) {
// CHECK: define {{.*}}void @test_v20
// CHECK: call void asm sideeffect "nop", "~{v20}"()
asm("nop" ::: "v20");
}
-void test_v21() {
+void test_v21(void) {
// CHECK: define {{.*}}void @test_v21
// CHECK: call void asm sideeffect "nop", "~{v21}"()
asm("nop" ::: "v21");
}
-void test_v22() {
+void test_v22(void) {
// CHECK: define {{.*}}void @test_v22
// CHECK: call void asm sideeffect "nop", "~{v22}"()
asm("nop" ::: "v22");
}
-void test_v23() {
+void test_v23(void) {
// CHECK: define {{.*}}void @test_v23
// CHECK: call void asm sideeffect "nop", "~{v23}"()
asm("nop" ::: "v23");
}
-void test_v24() {
+void test_v24(void) {
// CHECK: define {{.*}}void @test_v24
// CHECK: call void asm sideeffect "nop", "~{v24}"()
asm("nop" ::: "v24");
}
-void test_v25() {
+void test_v25(void) {
// CHECK: define {{.*}}void @test_v25
// CHECK: call void asm sideeffect "nop", "~{v25}"()
asm("nop" ::: "v25");
}
-void test_v26() {
+void test_v26(void) {
// CHECK: define {{.*}}void @test_v26
// CHECK: call void asm sideeffect "nop", "~{v26}"()
asm("nop" ::: "v26");
}
-void test_v27() {
+void test_v27(void) {
// CHECK: define {{.*}}void @test_v27
// CHECK: call void asm sideeffect "nop", "~{v27}"()
asm("nop" ::: "v27");
}
-void test_v28() {
+void test_v28(void) {
// CHECK: define {{.*}}void @test_v28
// CHECK: call void asm sideeffect "nop", "~{v28}"()
asm("nop" ::: "v28");
}
-void test_v29() {
+void test_v29(void) {
// CHECK: define {{.*}}void @test_v29
// CHECK: call void asm sideeffect "nop", "~{v29}"()
asm("nop" ::: "v29");
}
-void test_v30() {
+void test_v30(void) {
// CHECK: define {{.*}}void @test_v30
// CHECK: call void asm sideeffect "nop", "~{v30}"()
asm("nop" ::: "v30");
}
-void test_v31() {
+void test_v31(void) {
// CHECK: define {{.*}}void @test_v31
// CHECK: call void asm sideeffect "nop", "~{v31}"()
asm("nop" ::: "v31");
}
-void test_v1_0() {
+void test_v1_0(void) {
// CHECK: define {{.*}}void @test_v1_0
// CHECK: call void asm sideeffect "nop", "~{v1:0}"()
asm("nop" ::: "v1:0");
}
-void test_v3_2() {
+void test_v3_2(void) {
// CHECK: define {{.*}}void @test_v3_2
// CHECK: call void asm sideeffect "nop", "~{v3:2}"()
asm("nop" ::: "v3:2");
}
-void test_v5_4() {
+void test_v5_4(void) {
// CHECK: define {{.*}}void @test_v5_4
// CHECK: call void asm sideeffect "nop", "~{v5:4}"()
asm("nop" ::: "v5:4");
}
-void test_v7_6() {
+void test_v7_6(void) {
// CHECK: define {{.*}}void @test_v7_6
// CHECK: call void asm sideeffect "nop", "~{v7:6}"()
asm("nop" ::: "v7:6");
}
-void test_v9_8() {
+void test_v9_8(void) {
// CHECK: define {{.*}}void @test_v9_8
// CHECK: call void asm sideeffect "nop", "~{v9:8}"()
asm("nop" ::: "v9:8");
}
-void test_v11_10() {
+void test_v11_10(void) {
// CHECK: define {{.*}}void @test_v11_10
// CHECK: call void asm sideeffect "nop", "~{v11:10}"()
asm("nop" ::: "v11:10");
}
-void test_v13_12() {
+void test_v13_12(void) {
// CHECK: define {{.*}}void @test_v13_12
// CHECK: call void asm sideeffect "nop", "~{v13:12}"()
asm("nop" ::: "v13:12");
}
-void test_v15_14() {
+void test_v15_14(void) {
// CHECK: define {{.*}}void @test_v15_14
// CHECK: call void asm sideeffect "nop", "~{v15:14}"()
asm("nop" ::: "v15:14");
}
-void test_v17_16() {
+void test_v17_16(void) {
// CHECK: define {{.*}}void @test_v17_16
// CHECK: call void asm sideeffect "nop", "~{v17:16}"()
asm("nop" ::: "v17:16");
}
-void test_v19_18() {
+void test_v19_18(void) {
// CHECK: define {{.*}}void @test_v19_18
// CHECK: call void asm sideeffect "nop", "~{v19:18}"()
asm("nop" ::: "v19:18");
}
-void test_v21_20() {
+void test_v21_20(void) {
// CHECK: define {{.*}}void @test_v21_20
// CHECK: call void asm sideeffect "nop", "~{v21:20}"()
asm("nop" ::: "v21:20");
}
-void test_v23_22() {
+void test_v23_22(void) {
// CHECK: define {{.*}}void @test_v23_22
// CHECK: call void asm sideeffect "nop", "~{v23:22}"()
asm("nop" ::: "v23:22");
}
-void test_v25_24() {
+void test_v25_24(void) {
// CHECK: define {{.*}}void @test_v25_24
// CHECK: call void asm sideeffect "nop", "~{v25:24}"()
asm("nop" ::: "v25:24");
}
-void test_v27_26() {
+void test_v27_26(void) {
// CHECK: define {{.*}}void @test_v27_26
// CHECK: call void asm sideeffect "nop", "~{v27:26}"()
asm("nop" ::: "v27:26");
}
-void test_v29_28() {
+void test_v29_28(void) {
// CHECK: define {{.*}}void @test_v29_28
// CHECK: call void asm sideeffect "nop", "~{v29:28}"()
asm("nop" ::: "v29:28");
}
-void test_v31_30() {
+void test_v31_30(void) {
// CHECK: define {{.*}}void @test_v31_30
// CHECK: call void asm sideeffect "nop", "~{v31:30}"()
asm("nop" ::: "v31:30");
}
-void test_v3_0() {
+void test_v3_0(void) {
// CHECK: define {{.*}}void @test_v3_0
// CHECK: call void asm sideeffect "nop", "~{v3:0}"()
asm("nop" ::: "v3:0");
}
-void test_v7_4() {
+void test_v7_4(void) {
// CHECK: define {{.*}}void @test_v7_4
// CHECK: call void asm sideeffect "nop", "~{v7:4}"()
asm("nop" ::: "v7:4");
}
-void test_v11_8() {
+void test_v11_8(void) {
// CHECK: define {{.*}}void @test_v11_8
// CHECK: call void asm sideeffect "nop", "~{v11:8}"()
asm("nop" ::: "v11:8");
}
-void test_v15_12() {
+void test_v15_12(void) {
// CHECK: define {{.*}}void @test_v15_12
// CHECK: call void asm sideeffect "nop", "~{v15:12}"()
asm("nop" ::: "v15:12");
}
-void test_v19_16() {
+void test_v19_16(void) {
// CHECK: define {{.*}}void @test_v19_16
// CHECK: call void asm sideeffect "nop", "~{v19:16}"()
asm("nop" ::: "v19:16");
}
-void test_v23_20() {
+void test_v23_20(void) {
// CHECK: define {{.*}}void @test_v23_20
// CHECK: call void asm sideeffect "nop", "~{v23:20}"()
asm("nop" ::: "v23:20");
}
-void test_v27_24() {
+void test_v27_24(void) {
// CHECK: define {{.*}}void @test_v27_24
// CHECK: call void asm sideeffect "nop", "~{v27:24}"()
asm("nop" ::: "v27:24");
}
-void test_v31_28() {
+void test_v31_28(void) {
// CHECK: define {{.*}}void @test_v31_28
// CHECK: call void asm sideeffect "nop", "~{v31:28}"()
asm("nop" ::: "v31:28");
}
-void test_q0() {
+void test_q0(void) {
// CHECK: define {{.*}}void @test_q0
// CHECK: call void asm sideeffect "nop", "~{q0}"()
asm("nop" ::: "q0");
}
-void test_q1() {
+void test_q1(void) {
// CHECK: define {{.*}}void @test_q1
// CHECK: call void asm sideeffect "nop", "~{q1}"()
asm("nop" ::: "q1");
}
-void test_q2() {
+void test_q2(void) {
// CHECK: define {{.*}}void @test_q2
// CHECK: call void asm sideeffect "nop", "~{q2}"()
asm("nop" ::: "q2");
}
-void test_q3() {
+void test_q3(void) {
// CHECK: define {{.*}}void @test_q3
// CHECK: call void asm sideeffect "nop", "~{q3}"()
asm("nop" ::: "q3");
// CHECK-LABEL: define{{.*}} void @testdouble()
// CHECK: alloca double, align 4
-void testdouble() {
+void testdouble(void) {
double d = 2.0;
food(&d);
}
// CHECK-LABEL: define{{.*}} void @testlonglong()
// CHECK: alloca i64, align 4
-void testlonglong() {
+void testlonglong(void) {
long long ll = 2;
fooll(&ll);
}
// CHECK-LABEL: define{{.*}} void @testunsignedlonglong()
// CHECK: alloca i64, align 4
-void testunsignedlonglong() {
+void testunsignedlonglong(void) {
unsigned long long ull = 2;
fooull(&ull);
}
// CHECK-LABEL: define{{.*}} void @testlongdouble()
// CHECK: alloca double, align 4
-void testlongdouble() {
+void testlongdouble(void) {
long double ld = 2.0;
foold(&ld);
}
int global;
-static foo_t foo_ifunc() {
+static foo_t foo_ifunc(void) {
return global ? f1 : f2;
}
-int bar() {
+int bar(void) {
return foo(1);
}
typedef struct test10_B test10_F3(double);
void test10_foo(test10_F3 p1);
struct test10_B test10_b(double);
-void test10_bar() {
+void test10_bar(void) {
test10_foo(test10_b);
}
struct test10_B {};
return res;
}
-int main() {
+int main(void) {
return foo(3)+foo2(4);
}
// NO-TLSDIRECT: attributes #{{[0-9]+}} = {{{.*}} "indirect-tls-seg-refs"
// TLSDIRECT-NOT: attributes #{{[0-9]+}} = {{{.*}} "indirect-tls-seg-refs"
-void test1() {
+void test1(void) {
}
void use(void *);
-void test_small() {
+void test_small(void) {
// CHECK-LABEL: define{{.*}} void @test_small()
int a[] = {1, 2, 3, 4};
// CHECK: call void @llvm.memcpy.{{.*}}
use(a);
}
-void test_small_same() {
+void test_small_same(void) {
// CHECK-LABEL: define{{.*}} void @test_small_same()
char a[] = {'a', 'a', 'a', 'a'};
// CHECK: call void @llvm.memcpy.{{.*}}
use(a);
}
-void test_different() {
+void test_different(void) {
// CHECK-LABEL: define{{.*}} void @test_different()
int a[] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
// CHECK: call void @llvm.memcpy.{{.*}}
use(a);
}
-void test_all_zeros() {
+void test_all_zeros(void) {
// CHECK-LABEL: define{{.*}} void @test_all_zeros()
int a[16] = {};
// CHECK: call void @llvm.memset.{{.*}}
use(a);
}
-void test_all_a() {
+void test_all_a(void) {
// CHECK-LABEL: define{{.*}} void @test_all_a()
char a[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
// CHECK: call void @llvm.memcpy.{{.*}}
use(a);
}
-void test_most_zeros() {
+void test_most_zeros(void) {
// CHECK-LABEL: define{{.*}} void @test_most_zeros()
int a[16] = {0, 0, 1};
// CHECK: call void @llvm.memset.{{.*}}
use(a);
}
-void test_most_a() {
+void test_most_a(void) {
// CHECK-LABEL: define{{.*}} void @test_most_a()
char a[] = "aaaaazaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
// CHECK: call void @llvm.memcpy.{{.*}}
use(a);
}
-void test_pointers() {
+void test_pointers(void) {
// CHECK-LABEL: define{{.*}} void @test_pointers()
void *a[] = {&use, &use, &use, &use, &use, &use};
// CHECK: call void @llvm.memset.{{.*}}
// CHECK-DAG: [2 x [3 x i32]] {{[[][[]}}3 x i32] [i32 2222, i32 2222, i32 0], [3 x i32] [i32 2222, i32 2222, i32 3333]],
// CHECK-DAG: [[INIT14:.*]] = private global [16 x i32] [i32 0, i32 0, i32 0, i32 0, i32 0, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 17, i32 0, i32 0, i32 0, i32 0], align 4
-void f1() {
+void f1(void) {
// Scalars in braces.
int a = { 1 };
}
-void f2() {
+void f2(void) {
int a[2][2] = { { 1, 2 }, { 3, 4 } };
int b[3][3] = { { 1, 2 }, { 3, 4 } };
int *c[2] = { &a[1][1], &b[2][2] };
typedef void (* F)(void);
extern void foo(void);
struct S { F f; };
-void f3() {
+void f3(void) {
struct S a[1] = { { foo } };
}
// CHECK-DAG: @g3 ={{.*}} constant i32 10
// CHECK-DAG: @f4.g4 = internal constant i32 12
const int g3 = 10;
-int f4() {
+int f4(void) {
static const int g4 = 12;
return g4;
}
}
// rdar://problem/8154689
-void f6() {
+void f6(void) {
int x;
long ids[] = { (long) &x };
}
// CHECK: call void @bar
}
-void nonzeroMemseti8() {
+void nonzeroMemseti8(void) {
char arr[33] = { 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, };
// CHECK-LABEL: @nonzeroMemseti8(
// CHECK-NOT: store
// CHECK: call void @llvm.memset.p0i8.i32(i8* {{.*}}, i8 42, i32 33, i1 false)
}
-void nonzeroMemseti16() {
+void nonzeroMemseti16(void) {
unsigned short arr[17] = { 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, 0x4242, };
// CHECK-LABEL: @nonzeroMemseti16(
// CHECK-NOT: store
// CHECK: call void @llvm.memset.p0i8.i32(i8* {{.*}}, i8 66, i32 34, i1 false)
}
-void nonzeroMemseti32() {
+void nonzeroMemseti32(void) {
unsigned arr[9] = { 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, 0xF0F0F0F0, };
// CHECK-LABEL: @nonzeroMemseti32(
// CHECK-NOT: store
// CHECK: call void @llvm.memset.p0i8.i32(i8* {{.*}}, i8 -16, i32 36, i1 false)
}
-void nonzeroMemseti64() {
+void nonzeroMemseti64(void) {
unsigned long long arr[7] = { 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, 0xAAAAAAAAAAAAAAAA, };
// CHECK-LABEL: @nonzeroMemseti64(
// CHECK-NOT: store
// CHECK: call void @llvm.memset.p0i8.i32(i8* {{.*}}, i8 -86, i32 56, i1 false)
}
-void nonzeroMemsetf32() {
+void nonzeroMemsetf32(void) {
float arr[9] = { 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, 0x1.cacacap+75, };
// CHECK-LABEL: @nonzeroMemsetf32(
// CHECK-NOT: store
// CHECK: call void @llvm.memset.p0i8.i32(i8* {{.*}}, i8 101, i32 36, i1 false)
}
-void nonzeroMemsetf64() {
+void nonzeroMemsetf64(void) {
double arr[7] = { 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, 0x1.4444444444444p+69, };
// CHECK-LABEL: @nonzeroMemsetf64(
// CHECK-NOT: store
// CHECK: call void @llvm.memset.p0i8.i32(i8* {{.*}}, i8 68, i32 56, i1 false)
}
-void nonzeroPaddedUnionMemset() {
+void nonzeroPaddedUnionMemset(void) {
union U { char c; int i; };
union U arr[9] = { 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, };
// CHECK-LABEL: @nonzeroPaddedUnionMemset(
// CHECK: call void @llvm.memset.p0i8.i32(i8* {{.*}}, i8 -16, i32 36, i1 false)
}
-void nonzeroNestedMemset() {
+void nonzeroNestedMemset(void) {
union U { char c; int i; };
struct S { union U u; short i; };
struct S arr[5] = { { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, { {0xF0}, 0xF0F0 }, };
}
// CHECK-LABEL: @PR20473(
-void PR20473() {
+void PR20473(void) {
// CHECK: memcpy{{.*}}getelementptr inbounds ([2 x i8], [2 x i8]* @
bar((char[2]) {""});
// CHECK: memcpy{{.*}}getelementptr inbounds ([3 x i8], [3 x i8]* @
// CHECK-LABEL: @test_inlineasm_i
// CHECK: call void asm sideeffect "int $0", "i{{.*}}"(i32 2)
-void test_inlineasm_i() {
+void test_inlineasm_i(void) {
__asm__ __volatile__("int %0" :: "i"(1 + 1));
}
// CHECK-LABEL: @test_inlineasm_I
// CHECK: call void asm sideeffect "int $0", "I{{.*}}"(i32 2)
// CHECK: call void asm sideeffect "int $0", "I{{.*}}"(i32 3)
-void test_inlineasm_I() {
+void test_inlineasm_I(void) {
__asm__ __volatile__("int %0" :: "I"(1 + 1));
// Also check a C non-ICE.
#include <x86intrin.h>
#endif
-void f() {
+void f(void) {
// Intrinsic headers contain macros and inline functions.
// Inline assembly in both are checked only when they are
// referenced, so reference a few intrinsics here.
#include <immintrin.h>
-void f() {
+void f(void) {
__asm mov eax, ebx
__asm mov ebx, ecx
__asm__("movl %ecx, %edx");
return 1;
}
-_Bool check_no_clobber_conflicts() {
+_Bool check_no_clobber_conflicts(void) {
//CHECK-LABEL: @check_no_clobber_conflicts
//CHECK: = tail call i8 asm "", "={@cce},~{cx},~{dirflag},~{fpsr},~{flags}"()
_Bool b;
inline __attribute__ ((__always_inline__)) int inline_always(int a, int b) { return(a*b); }
volatile int *pa = (int*) 0x1000;
-void foo() {
+void foo(void) {
// NOINLINE-LABEL: @foo
// HINT-LABEL: @foo
// INLINE-LABEL: @foo
// Tests for signed integer overflow stuff.
// rdar://7432000 rdar://7221421
-void test1() {
+void test1(void) {
// DEFAULT-LABEL: define{{.*}} void @test1
// WRAPV-LABEL: define{{.*}} void @test1
// TRAPV-LABEL: define{{.*}} void @test1
void receivePtrs(void **);
-int main() {
+int main(void) {
L:
receivePtrs((void *[]){ &&L, 0, 0 });
}
int cc;
} s2;
// CHECK: define{{.*}} void @f2(%struct.s2* noalias sret(%struct.s2) align 4 %agg.result)
-s2 f2() {
+s2 f2(void) {
s2 foo;
return foo;
}
int dd;
} s3;
// CHECK: define{{.*}} void @f3(%struct.s3* noalias sret(%struct.s3) align 4 %agg.result)
-s3 f3() {
+s3 f3(void) {
s3 foo;
return foo;
}
void f2(int a, int b) __attribute((regparm(0)));
-void f0() {
+void f0(void) {
// CHECK: call void @f1(i32 inreg noundef 1, i32 inreg noundef 2, i32 inreg noundef 3, i32 inreg noundef 4,
// CHECK: i32 noundef 5, i32 noundef 6, i32 noundef 7, i32 noundef 8)
f1(1, 2, 3, 4, 5, 6, 7, 8);
extern int x;
// CHECK-LABEL: define{{.*}} i32 @f
-int f() {
+int f(void) {
int *p = &x;
// CHECK: ret i32 %{{.*}}, !dbg [[DI:![0-9]*]]
// CHECK: [[DI]] = !DILocation(line: [[@LINE+1]]
extern void use(char *a);
-__attribute__((always_inline)) void helper_no_markers() {
+__attribute__((always_inline)) void helper_no_markers(void) {
char a;
use(&a);
}
-void lifetime_test() {
+void lifetime_test(void) {
// O0: lifetime_test
// O1: lifetime_test
// O2: lifetime_test
}
// CHECK-LABEL: @no_goto_bypass
-void no_goto_bypass() {
+void no_goto_bypass(void) {
// O2: @llvm.lifetime.start.p0i8(i64 1
char x;
l1:
}
// CHECK-LABEL: @goto_bypass
-void goto_bypass() {
+void goto_bypass(void) {
{
// O2-NOT: @llvm.lifetime.start.p0i8(i64 1
// O2-NOT: @llvm.lifetime.end.p0i8(i64 1
// CHECK: @test2_i = internal global i32 99
static int test2_i = 99;
-int test2_f() {
+int test2_f(void) {
extern int test2_i;
return test2_i;
}
// PR3425
static void f(int x);
-void g0() {
+void g0(void) {
f(5);
}
// CHECK: !llvm.linker.options = !{![[msvcrt:[0-9]+]]}
// CHECK: ![[msvcrt]] = !{!"/include:foo"}
-int f();
+int f(void);
// This test should not exhibit use-after-free in LoopInfo.
-int a() {
+int a(void) {
for (;;)
for (;;)
for (;;)
int printf(const char * restrict format, ...);
-void for_test() {
+void for_test(void) {
double A[1000], B[1000];
int L = 500;
for (int i = 0; i < L; i++) {
int printf(const char * restrict format, ...);
-void for_test() {
+void for_test(void) {
double A[1000], B[1000];
int L = 500;
for (int i = 0; i < L; i++) {
// CHECK-THIN-OPTIMIZED: Running pass: NameAnonGlobalPass
// CHECK-THIN-OPTIMIZED: Running pass: ThinLTOBitcodeWriterPass
-void Foo() {}
+void Foo(void) {}
/* Sparc is not C99-compliant */
#if defined(sparc) || defined(__sparc__) || defined(__sparcv9)
-int main() { return 0; }
+int main(void) { return 0; }
#else /* sparc */
volatile double __complex__ accum;
-void mandel() {
+void mandel(void) {
int x, y, n;
for (y = 0; y < IMAGE_HEIGHT; ++y) {
for (x = 0; x < IMAGE_WIDTH; ++x) {
}
}
-int main() {
+int main(void) {
mandel();
return 0;
}
// ELF32: define{{.*}} x86_fastcallcc void @"\01@f2@0"
// ELF64: define{{.*}} void @f2(
-void __stdcall f3() {}
+void __stdcall f3(void) {}
// CHECK: define dso_local x86_stdcallcc void @"\01_f3@0"
// X64: define dso_local void @f3(
F->in = __builtin_matrix_transpose(__builtin_matrix_transpose(F->in));
}
-dx5x5_t get_matrix();
+dx5x5_t get_matrix(void);
-void transpose_rvalue() {
+void transpose_rvalue(void) {
// COMMON-LABEL: define{{.*}} void @transpose_rvalue()
// COMMON-NEXT: entry:
// CHECK32-NEXT: [[M_T_ADDR:%.*]] = alloca [25 x double], align 4
// CHECK64-NEXT: [[M_T_ADDR:%.*]] = alloca [25 x double], align 8
- // CHECK32-NEXT: [[CALL:%.*]] = call <25 x double> bitcast (<25 x double> (...)* @get_matrix to <25 x double> ()*)()
- // CHECK64-NEXT: [[CALL:%.*]] = call <25 x double> (...) @get_matrix()
+ // COMMON-NEXT: [[CALL:%.*]] = call <25 x double> @get_matrix()
// COMMON-NEXT: [[M_T:%.*]] = call <25 x double> @llvm.matrix.transpose.v25f64(<25 x double> [[CALL]], i32 5, i32 5)
// COMMON-NEXT: [[M_T_ADDR_C:%.*]] = bitcast [25 x double]* [[M_T_ADDR]] to <25 x double>*
// CHECK32-NEXT: store <25 x double> [[M_T]], <25 x double>* [[M_T_ADDR_C]], align 4
const dx5x5_t global_matrix;
-void transpose_global() {
+void transpose_global(void) {
// COMMON-LABEL: define{{.*}} void @transpose_global()
// COMMON-NEXT: entry:
// CHECK32-NEXT: [[M_T_ADDR:%.*]] = alloca [25 x double], align 4
dx5x5_t m = __builtin_matrix_column_major_load(Ptr, 5, 5, 5);
}
-void column_major_load_array2() {
+void column_major_load_array2(void) {
// COMMON-LABEL: define{{.*}} void @column_major_load_array2() #0 {
// COMMON-NEXT: entry:
// CHECK32-NEXT: [[PTR:%.*]] = alloca [25 x double], align 8
__builtin_matrix_column_major_store(m, Ptr, 5);
}
-void column_major_store_array2() {
+void column_major_store_array2(void) {
// COMMON-LABEL: define{{.*}} void @column_major_store_array2()
// CHECK32: [[M:%.*]] = load <25 x double>, <25 x double>* {{.*}}, align 4
// CHECK32-NEXT: [[PTR:%.*]] = getelementptr inbounds [25 x double], [25 x double]* %Ptr, i32 0, i32 0
}
typedef double dx4x4_t __attribute__((matrix_type(4, 4)));
-void matrix_inline_asm_memory_readwrite() {
+void matrix_inline_asm_memory_readwrite(void) {
// CHECK-LABEL: define{{.*}} void @matrix_inline_asm_memory_readwrite()
// CHECK-NEXT: entry:
// CHECK-NEXT: [[ALLOCA:%.+]] = alloca [16 x double], align 8
// CHECK: [[STRUCT1_TYPE:%.+]] = type {}
// CHECK: [[STRUCT2_TYPE:%.+]] = type { i32 }
-union U1 foo1() { return u1; }
-union U2 foo2() { return u2; }
-union U3 foo3() { return u3; }
-struct S1 bar1() { return s1; }
-struct S2 bar2() { return s2; }
+union U1 foo1(void) { return u1; }
+union U2 foo2(void) { return u2; }
+union U3 foo3(void) { return u3; }
+struct S1 bar1(void) { return s1; }
+struct S2 bar2(void) { return s2; }
struct S1 bar3(union U1 u) { return s1; }
// CHECK: define{{.*}} void @foo1()
// CHECK: define{{.*}} void @foo2([[UNION2_TYPE]]* noalias sret([[UNION2_TYPE]]) align 4 %{{.+}})
// CHECK: define{{.*}} i32 @bar2()
// CHECK: define{{.*}} void @bar3()
-void run() {
+void run(void) {
union U1 x1 = foo1();
union U2 x2 = foo2();
union U3 x3 = foo3();
void *malloc(__SIZE_TYPE__ size) __attribute__ ((__nothrow__));
-void fontFetch() {
+void fontFetch(void) {
__zend_malloc(1);
}
Any bad names will make the frontend choke.
*/
-main()
+main(void)
{
__asm__ __volatile__ (".set noat \n\t addi $7,$at,77":::"at");
// This checks that the frontend will accept inline asm constraints
// c', 'l' and 'x'.
-int main()
+int main(void)
{
// 'c': 16 bit address register for Mips16, GPR for all others
// I am using 'c' to constrain both the target and one of the source
// This checks that the frontend will accept inline asm memory constraints.
-int foo()
+int foo(void)
{
// 'R': An address that can be used in a non-macro load or stor'
// CHECK: %{{[0-9]+}} = call i32 asm "lw $0,${1:D};\0A", "=r,*m,~{$1}"(i32* elementtype(i32) getelementptr inbounds ([8 x i32], [8 x i32]* @b, i32 {{[0-9]+}}, i32 {{[0-9]+}})) #2,
// CHECK: %{{[0-9]+}} = call <4 x i32> asm "ldi.w ${0:w},1", "=f,~{$1}"
int b[8] = {0,1,2,3,4,5,6,7};
-int main()
+int main(void)
{
int i;
v4i32 v4i32_r;
// O32 does not support __int128 so it must be tested separately
// N32/N64 behave the same way so their tests have been combined into NEW
-int check_int128() {
+int check_int128(void) {
return sizeof(__int128); // O32: :[[@LINE]]:17: error: __int128 is not supported on this target
// NEW: ret i32 16
}
// RUN: %clang_cc1 -triple mips64-none-linux-gnu -emit-llvm -w -target-abi n32 -o - %s | FileCheck --check-prefix=ALL --check-prefix=N32 %s
// RUN: %clang_cc1 -triple mips64-none-linux-gnu -emit-llvm -w -o - %s | FileCheck --check-prefix=ALL --check-prefix=N64 %s
-int check_char() {
+int check_char(void) {
return sizeof(char);
// ALL: ret i32 1
}
-int check_short() {
+int check_short(void) {
return sizeof(short);
// ALL: ret i32 2
}
-int check_int() {
+int check_int(void) {
return sizeof(int);
// ALL: ret i32 4
}
-int check_long() {
+int check_long(void) {
return sizeof(long);
// O32: ret i32 4
// N32: ret i32 4
// N64: ret i32 8
}
-int check_longlong() {
+int check_longlong(void) {
return sizeof(long long);
// ALL: ret i32 8
}
-int check_fp16() {
+int check_fp16(void) {
return sizeof(__fp16);
// ALL: ret i32 2
}
-int check_float() {
+int check_float(void) {
return sizeof(float);
// ALL: ret i32 4
}
-int check_double() {
+int check_double(void) {
return sizeof(double);
// ALL: ret i32 8
}
-int check_longdouble() {
+int check_longdouble(void) {
return sizeof(long double);
// O32: ret i32 8
// N32: ret i32 16
// N64: ret i32 16
}
-int check_floatComplex() {
+int check_floatComplex(void) {
return sizeof(float _Complex);
// ALL: ret i32 8
}
-int check_doubleComplex() {
+int check_doubleComplex(void) {
return sizeof(double _Complex);
// ALL: ret i32 16
}
-int check_longdoubleComplex() {
+int check_longdoubleComplex(void) {
return sizeof(long double _Complex);
// O32: ret i32 16
// N32: ret i32 32
// N64: ret i32 32
}
-int check_bool() {
+int check_bool(void) {
return sizeof(_Bool);
// ALL: ret i32 1
}
-int check_wchar() {
+int check_wchar(void) {
return sizeof(__WCHAR_TYPE__);
// ALL: ret i32 4
}
-int check_wchar_is_unsigned() {
+int check_wchar_is_unsigned(void) {
return (__WCHAR_TYPE__)-1 > (__WCHAR_TYPE__)0;
// ALL: ret i32 0
}
-int check_ptr() {
+int check_ptr(void) {
return sizeof(void *);
// O32: ret i32 4
// N32: ret i32 4
return a;
}
-void foo1() {
+void foo1(void) {
unsigned f = 0xffffffe0;
foo(1,f);
}
void foo(unsigned a) {
}
-void foo1() {
+void foo1(void) {
unsigned f = 0xffffffe0;
foo(f);
}
// CHECK: ret fp128
-LD foo0() {
+LD foo0(void) {
return 2.625L;
}
};
-void foo()
+void foo(void)
{
// CHECK: %var = alloca %struct.test, align 4
struct test var;
#include <intrin.h>
-void test_ReadWriteBarrier() { _ReadWriteBarrier(); }
+void test_ReadWriteBarrier(void) { _ReadWriteBarrier(); }
// CHECK-LABEL: define dso_local void @test_ReadWriteBarrier
// CHECK: fence syncscope("singlethread") seq_cst
// CHECK: ret void
// CHECK: }
-void test_ReadBarrier() { _ReadBarrier(); }
+void test_ReadBarrier(void) { _ReadBarrier(); }
// CHECK-LABEL: define dso_local void @test_ReadBarrier
// CHECK: fence syncscope("singlethread") seq_cst
// CHECK: ret void
// CHECK: }
-void test_WriteBarrier() { _WriteBarrier(); }
+void test_WriteBarrier(void) { _WriteBarrier(); }
// CHECK-LABEL: define dso_local void @test_WriteBarrier
// CHECK: fence syncscope("singlethread") seq_cst
// CHECK: ret void
// CHECK: }
#if defined(__x86_64__)
-void test__faststorefence() { __faststorefence(); }
+void test__faststorefence(void) { __faststorefence(); }
// CHECK-X64-LABEL: define dso_local void @test__faststorefence
// CHECK-X64: fence seq_cst
// CHECK-X64: ret void
// CHECK: define dso_local void @t3() [[NAKED:#[0-9]+]] {
-__declspec(naked) void t3() {}
+__declspec(naked) void t3(void) {}
// CHECK: define dso_local void @t22() [[NUW:#[0-9]+]]
-void __declspec(nothrow) t22();
-void t22() {}
+void __declspec(nothrow) t22(void);
+void t22(void) {}
// CHECK: define dso_local void @t2() [[NI:#[0-9]+]] {
-__declspec(noinline) void t2() {}
+__declspec(noinline) void t2(void) {}
// CHECK: call void @f20_t() [[NR:#[0-9]+]]
__declspec(noreturn) void f20_t(void);
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
-void t1() {
+void t1(void) {
int var = 10;
__asm mov rax, offset var ; rax = address of myvar
// CHECK: t1
// CHECK-SAME: "r,~{rax},~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}})
}
-void t2() {
+void t2(void) {
int var = 10;
__asm mov qword ptr [eax], offset var
// CHECK: t2
struct t3_type { int a, b; };
-int t3() {
+int t3(void) {
struct t3_type foo;
foo.a = 1;
foo.b = 2;
// CHECK-SAME: "*m,~{eax},~{ebx},~{dirflag},~{fpsr},~{flags}"(%struct.t3_type* elementtype(%struct.t3_type) %{{.*}})
}
-int t4() {
+int t4(void) {
struct t3_type foo;
foo.a = 1;
foo.b = 2;
void bar() {}
-void t5() {
+void t5(void) {
__asm {
call bar
jmp bar
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .even
-void t1() {
+void t1(void) {
__asm {
.byte 64
.byte 64
// Intel inline assembly parser should rewrite to the appropriate form depending
// on the platform.
-void align_test() {
+void align_test(void) {
__asm align 8
__asm align 16;
__asm align 128;
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple x86_64-pc-windows-msvc -target-cpu skylake-avx512 -fasm-blocks -emit-llvm -o - | FileCheck %s
-void t1() {
+void t1(void) {
// CHECK: @t1
// CHECK: call void asm sideeffect inteldialect "vaddpd zmm8, zmm27, zmm6", "~{zmm8},~{dirflag},~{fpsr},~{flags}"()
// CHECK: ret void
}
-void t2() {
+void t2(void) {
// CHECK: @t2
// CHECK: call void asm sideeffect inteldialect "vaddpd zmm8 {k1}, zmm27, zmm6", "~{zmm8},~{dirflag},~{fpsr},~{flags}"()
// CHECK: ret void
}
}
-void ignore_fe_size() {
+void ignore_fe_size(void) {
// CHECK-LABEL: define dso_local void @ignore_fe_size()
char c;
// CHECK: vaddps xmm1, xmm2, $1{1to4}
int k(int);
__declspec(dllimport) int kimport(int);
int (*kptr)(int);
-int (*gptr())(int);
+int (*gptr(void))(int);
-int foo() {
+int foo(void) {
// CHECK-LABEL: _foo:
int (*r)(int) = gptr();
// CHECK-FIXME: calll *_kptr
}
-int bar() {
+int bar(void) {
// CHECK-LABEL: _bar:
__asm jmp k;
// CHECK: jmp _k
}
-int baz() {
+int baz(void) {
// CHECK-LABEL: _baz:
__asm mov eax, k;
// CHECK: movl _k, %eax
// Test that this asm blob doesn't require more registers than available. This
// has to be an LLVM code generation test.
-void __declspec(naked) naked() {
+void __declspec(naked) naked(void) {
__asm pusha
__asm call k
__asm popa
// RUN: %clang_cc1 %s -fasm-blocks -triple i386-apple-darwin10 -emit-llvm -o - | FileCheck %s
static int arr[10];
-void t1() {
+void t1(void) {
// CHECK: @arr = internal global [10 x i32]
// CHECK: call void asm sideeffect inteldialect "mov dword ptr arr[edx * $$4],edx", "=*m,{{.*}}([10 x i32]* elementtype([10 x i32]) @arr)
__asm mov dword ptr arr[edx*4],edx
// RUN: %clang_cc1 %s -fasm-blocks -triple i386-apple-darwin10 -emit-llvm -o - | FileCheck %s
int gVar;
-void t1() {
+void t1(void) {
// CHECK: add eax, dword ptr gVar[eax]
__asm add eax, dword ptr gVar[eax]
// CHECK: add dword ptr gVar[eax], eax
__asm add 1 + 1 + 2 + 3[gVar + ecx + ebx], eax
}
-void t2() {
+void t2(void) {
int lVar;
// CHECK: mov eax, dword ptr ${{[0-9]}}[eax]
__asm mov eax, dword ptr lVar[eax]
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s
-void t1() {
+void t1(void) {
// CHECK: @t1
// CHECK: call void asm sideeffect inteldialect "", "~{dirflag},~{fpsr},~{flags}"()
// CHECK: ret void
__asm {}
}
-void t2() {
+void t2(void) {
// CHECK: @t2
// CHECK: call void asm sideeffect inteldialect "nop\0A\09nop\0A\09nop", "~{dirflag},~{fpsr},~{flags}"()
// CHECK: ret void
__asm nop
}
-void t3() {
+void t3(void) {
// CHECK: @t3
// CHECK: call void asm sideeffect inteldialect "nop\0A\09nop\0A\09nop", "~{dirflag},~{fpsr},~{flags}"()
// CHECK: ret void
// CHECK: call void asm sideeffect inteldialect "int $$44", "~{dirflag},~{fpsr},~{flags}"()
}
-void t7() {
+void t7(void) {
__asm {
int 0x2cU ; } asm comments are fun! }{
}
// CHECK: call void asm sideeffect inteldialect "mov eax, ebx", "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-int t8() {
+int t8(void) {
__asm int 4 ; } comments for single-line asm
__asm {}
__asm { int 5}
// CHECK: ret i32 10
}
-void t9() {
+void t9(void) {
__asm {
push ebx
{ mov ebx, 0x07 }
// CHECK-SAME: "=*m,=*m,=&{eax},*m,*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}})
}
-void t13() {
+void t13(void) {
char i = 1;
short j = 2;
__asm movzx eax, i
// CHECK-SAME: "*m,*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %{{.*}}i, i16* elementtype(i16) %{{.*}}j)
}
-void t13_brac() {
+void t13_brac(void) {
char i = 1;
short j = 2;
__asm movzx eax, [i]
// CHECK-SAME: "*m,*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i8* elementtype(i8) %{{.*}}i, i16* elementtype(i16) %{{.*}}j)
}
-void t14() {
+void t14(void) {
unsigned i = 1, j = 2;
__asm {
.if 1
}
int gvar = 10;
-void t15() {
+void t15(void) {
// CHECK: t15
int lvar = 10;
__asm mov eax, lvar ; eax = 10
// CHECK: "*m,r,i,i,i,i,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %{{.*}}, i32* %{{.*}}, i32* @{{.*}}, i32* @{{.*}}, i32* @{{.*}}, i32* @{{.*}})
}
-void t16() {
+void t16(void) {
int var = 10;
__asm mov dword ptr [eax], offset var
// CHECK: t16
// CHECK: call void asm sideeffect inteldialect "mov dword ptr [eax], $0", "r,~{dirflag},~{fpsr},~{flags}"(i32* %{{.*}})
}
-void t17() {
+void t17(void) {
// CHECK: t17
__asm _emit 0x4A
// CHECK: .byte 0x4A
// CHECK: "~{dirflag},~{fpsr},~{flags}"()
}
-void t20() {
+void t20(void) {
// CHECK: t20
char bar;
int foo;
}
-void t21() {
+void t21(void) {
__asm {
__asm push ebx
__asm mov ebx, 07H
}
extern void t22_helper(int x);
-void t22() {
+void t22(void) {
int x = 0;
__asm {
__asm push ebx
// CHECK-SAME: "~{ebx},~{esp},~{dirflag},~{fpsr},~{flags}"()
}
-void t23() {
+void t23(void) {
__asm {
the_label:
}
}
void t24_helper(void) {}
-void t24() {
+void t24(void) {
__asm call t24_helper
// CHECK: t24
// CHECK: call void asm sideeffect inteldialect "call dword ptr ${0:P}", "*m,~{dirflag},~{fpsr},~{flags}"(void ()* elementtype(void ()) @t24_helper)
}
-void t25() {
+void t25(void) {
// CHECK: t25
__asm mov eax, 0ffffffffh
// CHECK: mov eax, $$4294967295
// CHECK: "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-void t26() {
+void t26(void) {
// CHECK: t26
__asm pushad
// CHECK: pushad
// CHECK: "~{eax},~{ebp},~{ebx},~{ecx},~{edi},~{edx},~{esi},~{esp},~{dirflag},~{fpsr},~{flags}"()
}
-void t27() {
+void t27(void) {
__asm mov eax, fs:[0h]
// CHECK: t27
// CHECK: call void asm sideeffect inteldialect "mov eax, fs:[$$0]", "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-void t28() {
+void t28(void) {
// CHECK: t28
__asm align 8
// CHECK: .align 3
// CHECK: "~{dirflag},~{fpsr},~{flags}"()
}
-void t29() {
+void t29(void) {
// CHECK: t29
int arr[2] = {0, 0};
int olen = 0, osize = 0, otype = 0;
}
int results[2] = {13, 37};
-int *t30()
+int *t30(void)
// CHECK: t30
{
int *res;
// CHECK: "=*m,={eax},*m,~{edi},~{dirflag},~{fpsr},~{flags}"(i32** elementtype(i32*) %{{.*}}, [2 x i32]* elementtype([2 x i32]) @{{.*}})
}
-void t31() {
+void t31(void) {
// CHECK: t31
__asm pushad
// CHECK: pushad
// CHECK: "~{eax},~{ebp},~{ebx},~{ecx},~{edi},~{edx},~{esi},~{esp},~{dirflag},~{fpsr},~{flags}"()
}
-void t32() {
+void t32(void) {
// CHECK: t32
int i;
__asm mov eax, i
// CHECK: "*m,*m,*m,*m,~{al},~{ax},~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}})
}
-void t33() {
+void t33(void) {
// CHECK: t33
int i;
__asm mov eax, [i]
// CHECK: "*m,*m,*m,*m,~{al},~{ax},~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}}, i32* elementtype(i32) %{{.*}})
}
-void t34() {
+void t34(void) {
// CHECK: t34
__asm prefetchnta 64[eax]
// CHECK: prefetchnta [eax + $$64]
// CHECK: "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-void t35() {
+void t35(void) {
// CHECK: t35
__asm prefetchnta [eax + (200*64)]
// CHECK: prefetchnta [eax + $$12800]
// CHECK: "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-void t36() {
+void t36(void) {
// CHECK: t36
int arr[4];
// Work around PR20368: These should be single line blocks
// CHECK: call void asm sideeffect inteldialect "mov eax, $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* elementtype([4 x i32]) %{{.*}})
}
-void t37() {
+void t37(void) {
// CHECK: t37
__asm mov eax, 4 + 8
// CHECK: mov eax, $$12
// CHECK: "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-void t38() {
+void t38(void) {
// CHECK: t38
int arr[4];
// Work around PR20368: These should be single line blocks
// CHECK: call void asm sideeffect inteldialect "mov eax, $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"([4 x i32]* elementtype([4 x i32]) %{{.*}})
}
-void cpuid() {
+void cpuid(void) {
__asm cpuid
// CHECK-LABEL: define{{.*}} void @cpuid
// CHECK: call void asm sideeffect inteldialect "cpuid", "~{eax},~{ebx},~{ecx},~{edx},~{dirflag},~{fpsr},~{flags}"()
B c4;
} C, *pC;
-void t39() {
+void t39(void) {
// CHECK-LABEL: define{{.*}} void @t39
__asm mov eax, [eax].A.b
// CHECK: mov eax, [eax + $$4]
// CHECK: "*m,*m,*m,*m,*m,*m,~{dirflag},~{fpsr},~{flags}"(i16* {{.*}}, i16* {{.*}}, i16* {{.*}}, i16* {{.*}}, i16* {{.*}}, i16* {{.*}})
}
-void t42() {
+void t42(void) {
// CHECK-LABEL: define{{.*}} void @t42(
int flags;
__asm mov flags, eax
// CHECK: "=*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %flags)
}
-void t42b() {
+void t42b(void) {
// CHECK-LABEL: define{{.*}} void @t42b(
int mxcsr;
__asm mov mxcsr, eax
// CHECK: "=*m,~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %mxcsr)
}
-void t43() {
+void t43(void) {
// CHECK-LABEL: define{{.*}} void @t43
C strct;
// Work around PR20368: These should be single line blocks
// CHECK: call void asm sideeffect inteldialect "mov eax, $0", "*m,~{eax},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %{{.*}})
}
-void t44() {
+void t44(void) {
// CHECK-LABEL: define{{.*}} void @t44
__asm {
mov cr0, eax
// CHECK: call void asm sideeffect inteldialect "mov cr0, eax\0A\09mov cr2, ebx\0A\09mov cr3, ecx\0A\09mov cr4, edx", "~{cr0},~{cr2},~{cr3},~{cr4},~{dirflag},~{fpsr},~{flags}"()
}
-void t45() {
+void t45(void) {
// CHECK-LABEL: define{{.*}} void @t45
__asm {
mov dr0, eax
// CHECK: call void asm sideeffect inteldialect "mov dr0, eax\0A\09mov dr1, ebx\0A\09mov dr2, ebx\0A\09mov dr3, ecx\0A\09mov dr6, edx\0A\09mov dr7, ecx", "~{dr0},~{dr1},~{dr2},~{dr3},~{dr6},~{dr7},~{dirflag},~{fpsr},~{flags}"()
}
-void t46() {
+void t46(void) {
// CHECK-LABEL: define{{.*}} void @t46
__asm add eax, -128[eax]
// CHECK: call void asm sideeffect inteldialect "add eax, [eax + $$-128]", "~{eax},~{flags},~{dirflag},~{fpsr},~{flags}"()
}
-void dot_operator(){
+void dot_operator(void){
// CHECK-LABEL: define{{.*}} void @dot_operator
__asm { mov eax, 3[ebx]A.b}
// CHECK: call void asm sideeffect inteldialect "mov eax, [ebx + $$7]", "~{eax},~{dirflag},~{fpsr},~{flags}"
}
-void call_clobber() {
+void call_clobber(void) {
__asm call t41
// CHECK-LABEL: define{{.*}} void @call_clobber
// CHECK: call void asm sideeffect inteldialect "call dword ptr ${0:P}", "*m,~{dirflag},~{fpsr},~{flags}"(void (i16)* elementtype(void (i16)) @t41)
}
-void xgetbv() {
+void xgetbv(void) {
__asm xgetbv
}
// CHECK-LABEL: define{{.*}} void @xgetbv()
// CHECK: call void asm sideeffect inteldialect "xgetbv", "~{eax},~{edx},~{dirflag},~{fpsr},~{flags}"()
-void label1() {
+void label1(void) {
__asm {
label:
jmp label
// CHECK: call void asm sideeffect inteldialect "{{.*}}__MSASMLABEL_.${:uid}__label:\0A\09jmp {{.*}}__MSASMLABEL_.${:uid}__label", "~{dirflag},~{fpsr},~{flags}"() [[ATTR1:#[0-9]+]]
}
-void label2() {
+void label2(void) {
__asm {
jmp label
label:
// CHECK: call void asm sideeffect inteldialect "jmp {{.*}}__MSASMLABEL_.${:uid}__label\0A\09{{.*}}__MSASMLABEL_.${:uid}__label:", "~{dirflag},~{fpsr},~{flags}"()
}
-void label3() {
+void label3(void) {
__asm {
label:
mov eax, label
// CHECK: call void asm sideeffect inteldialect "{{.*}}__MSASMLABEL_.${:uid}__label:\0A\09mov eax, {{.*}}__MSASMLABEL_.${:uid}__label", "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-void label4() {
+void label4(void) {
__asm {
label:
mov eax, [label]
// CHECK: call void asm sideeffect inteldialect "{{.*}}__MSASMLABEL_.${:uid}__label:\0A\09mov eax, {{.*}}__MSASMLABEL_.${:uid}__label", "~{eax},~{dirflag},~{fpsr},~{flags}"()
}
-void label5() {
+void label5(void) {
__asm {
jmp dollar_label$
dollar_label$:
// CHECK: call void asm sideeffect inteldialect "jmp {{.*}}__MSASMLABEL_.${:uid}__dollar_label$$\0A\09{{.*}}__MSASMLABEL_.${:uid}__dollar_label$$:", "~{dirflag},~{fpsr},~{flags}"()
}
-void label6(){
+void label6(void){
__asm {
jmp short label
jc short label
}
// Don't include mxcsr in the clobber list.
-void mxcsr() {
+void mxcsr(void) {
char buf[4096];
__asm fxrstor buf
}
// CHECK: call void asm sideeffect inteldialect "fxrstor $0", "=*m,~{fpcr},~{dirflag},~{fpsr},~{flags}"
// Make sure we can find the register for the dirflag for popfd
-void dirflag() {
+void dirflag(void) {
__asm popfd
}
// CHECK-LABEL: define{{.*}} void @dirflag
#endif
-void *test_ReturnAddress() {
+void *test_ReturnAddress(void) {
return _ReturnAddress();
}
// CHECK-LABEL: define{{.*}}i8* @test_ReturnAddress()
// CHECK: ret i8*
#if defined(__i386__) || defined(__x86_64__) || defined (__aarch64__)
-void *test_AddressOfReturnAddress() {
+void *test_AddressOfReturnAddress(void) {
return _AddressOfReturnAddress();
}
// CHECK-INTEL-LABEL: define dso_local i8* @test_AddressOfReturnAddress()
// CHECK-ARM-ARM64: }
#endif
-void test__fastfail() {
+void test__fastfail(void) {
__fastfail(42);
}
// CHECK-LABEL: define{{.*}} void @test__fastfail()
jmp_buf jb;
-int test_setjmp() {
+int test_setjmp(void) {
return _setjmp(jb);
// I386-LABEL: define dso_local i32 @test_setjmp
// I386: %[[call:.*]] = call i32 (i8*, i32, ...) @_setjmp3(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @jb, i32 0, i32 0), i32 0)
// AARCH64-NEXT: ret i32 %[[call]]
}
-int test_setjmpex() {
+int test_setjmpex(void) {
return _setjmpex(jb);
// X64-LABEL: define dso_local i32 @test_setjmpex
// X64: %[[addr:.*]] = call i8* @llvm.frameaddress.p0i8(i32 0)
int i4;
} t3 = {1,2,3,4};
-int main() {
+int main(void) {
if (sizeof(t1) != 2)
abort();
if (t1.foo != 'a')
int marray[2];
// CHECK: @single_m
-void single_m()
+void single_m(void)
{
// CHECK: call void asm "foo $1,$0", "=*m,*m[[CLOBBERS:[a-zA-Z0-9@%{},~_$ ]*\"]](i32* elementtype(i32) {{[a-zA-Z0-9@%]+}}, i32* elementtype(i32) {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=m" (mout0) : "m" (min1));
}
// CHECK: @single_o
-void single_o()
+void single_o(void)
{
register int out0 = 0;
register int index = 1;
}
// CHECK: @single_V
-void single_V()
+void single_V(void)
{
// asm("foo %1,%0" : "=m" (mout0) : "V" (min1));
}
// CHECK: @single_lt
-void single_lt()
+void single_lt(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @single_gt
-void single_gt()
+void single_gt(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @single_r
-void single_r()
+void single_r(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @single_i
-void single_i()
+void single_i(void)
{
register int out0 = 0;
// CHECK: call i32 asm "foo $1,$0", "=r,i[[CLOBBERS]](i32 1)
}
// CHECK: @single_n
-void single_n()
+void single_n(void)
{
register int out0 = 0;
// CHECK: call i32 asm "foo $1,$0", "=r,n[[CLOBBERS]](i32 1)
}
// CHECK: @single_E
-void single_E()
+void single_E(void)
{
register double out0 = 0.0;
// CHECK: call double asm "foo $1,$0", "=r,E[[CLOBBERS]](double {{[0-9.eE+-]+}})
}
// CHECK: @single_F
-void single_F()
+void single_F(void)
{
register double out0 = 0.0;
// CHECK: call double asm "foo $1,$0", "=r,F[[CLOBBERS]](double {{[0-9.eE+-]+}})
}
// CHECK: @single_s
-void single_s()
+void single_s(void)
{
register int out0 = 0;
//asm("foo %1,%0" : "=r" (out0) : "s" (single_s));
}
// CHECK: @single_g
-void single_g()
+void single_g(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @single_X
-void single_X()
+void single_X(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @single_p
-void single_p()
+void single_p(void)
{
register int out0 = 0;
// Constraint converted differently on different platforms moved to platform-specific.
}
// CHECK: @multi_m
-void multi_m()
+void multi_m(void)
{
// CHECK: call void asm "foo $1,$0", "=*m|r,m|r[[CLOBBERS]](i32* elementtype(i32) {{[a-zA-Z0-9@%]+}}, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=m,r" (mout0) : "m,r" (min1));
}
// CHECK: @multi_o
-void multi_o()
+void multi_o(void)
{
register int out0 = 0;
register int index = 1;
}
// CHECK: @multi_V
-void multi_V()
+void multi_V(void)
{
// asm("foo %1,%0" : "=m,r" (mout0) : "r,V" (min1));
}
// CHECK: @multi_lt
-void multi_lt()
+void multi_lt(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @multi_gt
-void multi_gt()
+void multi_gt(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @multi_r
-void multi_r()
+void multi_r(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @multi_i
-void multi_i()
+void multi_i(void)
{
register int out0 = 0;
// CHECK: call i32 asm "foo $1,$0", "=r|r,r|i[[CLOBBERS]](i32 1)
}
// CHECK: @multi_n
-void multi_n()
+void multi_n(void)
{
register int out0 = 0;
// CHECK: call i32 asm "foo $1,$0", "=r|r,r|n[[CLOBBERS]](i32 1)
}
// CHECK: @multi_E
-void multi_E()
+void multi_E(void)
{
register double out0 = 0.0;
// CHECK: call double asm "foo $1,$0", "=r|r,r|E[[CLOBBERS]](double {{[0-9.eE+-]+}})
}
// CHECK: @multi_F
-void multi_F()
+void multi_F(void)
{
register double out0 = 0.0;
// CHECK: call double asm "foo $1,$0", "=r|r,r|F[[CLOBBERS]](double {{[0-9.eE+-]+}})
}
// CHECK: @multi_s
-void multi_s()
+void multi_s(void)
{
register int out0 = 0;
//asm("foo %1,%0" : "=r,r" (out0) : "r,s" (multi_s));
}
// CHECK: @multi_g
-void multi_g()
+void multi_g(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @multi_X
-void multi_X()
+void multi_X(void)
{
register int out0 = 0;
register int in1 = 1;
}
// CHECK: @multi_p
-void multi_p()
+void multi_p(void)
{
register int out0 = 0;
// Constraint converted differently on different platforms moved to platform-specific.
double din1;
// CHECK: @single_R
-void single_R()
+void single_R(void)
{
// CHECK: asm "foo $1,$0", "=R,R[[CLOBBERS:[a-zA-Z0-9@%{},~_ ]*\"]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=R" (mout0) : "R" (min1));
}
// CHECK: @single_q
-void single_q()
+void single_q(void)
{
// CHECK: asm "foo $1,$0", "=q,q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=q" (mout0) : "q" (min1));
}
// CHECK: @single_Q
-void single_Q()
+void single_Q(void)
{
// CHECK: asm "foo $1,$0", "=Q,Q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=Q" (mout0) : "Q" (min1));
}
// CHECK: @single_a
-void single_a()
+void single_a(void)
{
// CHECK: asm "foo $1,$0", "={ax},{ax}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=a" (mout0) : "a" (min1));
}
// CHECK: @single_b
-void single_b()
+void single_b(void)
{
// CHECK: asm "foo $1,$0", "={bx},{bx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=b" (mout0) : "b" (min1));
}
// CHECK: @single_c
-void single_c()
+void single_c(void)
{
// CHECK: asm "foo $1,$0", "={cx},{cx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=c" (mout0) : "c" (min1));
}
// CHECK: @single_d
-void single_d()
+void single_d(void)
{
// CHECK: asm "foo $1,$0", "={dx},{dx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=d" (mout0) : "d" (min1));
}
// CHECK: @single_S
-void single_S()
+void single_S(void)
{
// CHECK: asm "foo $1,$0", "={si},{si}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=S" (mout0) : "S" (min1));
}
// CHECK: @single_D
-void single_D()
+void single_D(void)
{
// CHECK: asm "foo $1,$0", "={di},{di}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=D" (mout0) : "D" (min1));
}
// CHECK: @single_A
-void single_A()
+void single_A(void)
{
// CHECK: asm "foo $1,$0", "=A,A[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=A" (mout0) : "A" (min1));
}
// CHECK: @single_f
-void single_f()
+void single_f(void)
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @single_t
-void single_t()
+void single_t(void)
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @single_u
-void single_u()
+void single_u(void)
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @single_y
-void single_y()
+void single_y(void)
{
// CHECK: call double asm "foo $1,$0", "=y,y[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=y" (dout0) : "y" (din1));
}
// CHECK: @single_x
-void single_x()
+void single_x(void)
{
// CHECK: asm "foo $1,$0", "=x,x[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=x" (dout0) : "x" (din1));
}
// CHECK: @single_Y
-void single_Y()
+void single_Y(void)
{
// 'Y' constraint currently broken.
//asm("foo %1,%0" : "=Y0" (mout0) : "Y0" (min1));
}
// CHECK: @single_I
-void single_I()
+void single_I(void)
{
// CHECK: asm "foo $1,$0", "=*m,I[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "I" (1));
}
// CHECK: @single_J
-void single_J()
+void single_J(void)
{
// CHECK: asm "foo $1,$0", "=*m,J[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "J" (1));
}
// CHECK: @single_K
-void single_K()
+void single_K(void)
{
// CHECK: asm "foo $1,$0", "=*m,K[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "K" (1));
}
// CHECK: @single_L
-void single_L()
+void single_L(void)
{
// CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 255)
asm("foo %1,%0" : "=m" (mout0) : "L" (0xff));
}
// CHECK: @single_M
-void single_M()
+void single_M(void)
{
// CHECK: asm "foo $1,$0", "=*m,M[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "M" (1));
}
// CHECK: @single_N
-void single_N()
+void single_N(void)
{
// CHECK: asm "foo $1,$0", "=*m,N[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "N" (1));
}
// CHECK: @single_G
-void single_G()
+void single_G(void)
{
// CHECK: asm "foo $1,$0", "=*m,G[[CLOBBERS]](i32* elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=m" (mout0) : "G" (1.0));
}
// CHECK: @single_C
-void single_C()
+void single_C(void)
{
// CHECK: asm "foo $1,$0", "=*m,C[[CLOBBERS]](i32* elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=m" (mout0) : "C" (1.0));
}
// CHECK: @single_e
-void single_e()
+void single_e(void)
{
// CHECK: asm "foo $1,$0", "=*m,e[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "e" (1));
}
// CHECK: @single_Z
-void single_Z()
+void single_Z(void)
{
// CHECK: asm "foo $1,$0", "=*m,Z[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=m" (mout0) : "Z" (1));
}
// CHECK: @multi_R
-void multi_R()
+void multi_R(void)
{
// CHECK: asm "foo $1,$0", "=*r|R|m,r|R|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,R,m" (mout0) : "r,R,m" (min1));
}
// CHECK: @multi_q
-void multi_q()
+void multi_q(void)
{
// CHECK: asm "foo $1,$0", "=*r|q|m,r|q|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,q,m" (mout0) : "r,q,m" (min1));
}
// CHECK: @multi_Q
-void multi_Q()
+void multi_Q(void)
{
// CHECK: asm "foo $1,$0", "=*r|Q|m,r|Q|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,Q,m" (mout0) : "r,Q,m" (min1));
}
// CHECK: @multi_a
-void multi_a()
+void multi_a(void)
{
// CHECK: asm "foo $1,$0", "=*r|{ax}|m,r|{ax}|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,a,m" (mout0) : "r,a,m" (min1));
}
// CHECK: @multi_b
-void multi_b()
+void multi_b(void)
{
// CHECK: asm "foo $1,$0", "=*r|{bx}|m,r|{bx}|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,b,m" (mout0) : "r,b,m" (min1));
}
// CHECK: @multi_c
-void multi_c()
+void multi_c(void)
{
// CHECK: asm "foo $1,$0", "=*r|{cx}|m,r|{cx}|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,c,m" (mout0) : "r,c,m" (min1));
}
// CHECK: @multi_d
-void multi_d()
+void multi_d(void)
{
// CHECK: asm "foo $1,$0", "=*r|{dx}|m,r|{dx}|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,d,m" (mout0) : "r,d,m" (min1));
}
// CHECK: @multi_S
-void multi_S()
+void multi_S(void)
{
// CHECK: asm "foo $1,$0", "=*r|{si}|m,r|{si}|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,S,m" (mout0) : "r,S,m" (min1));
}
// CHECK: @multi_D
-void multi_D()
+void multi_D(void)
{
// CHECK: asm "foo $1,$0", "=*r|{di}|m,r|{di}|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,D,m" (mout0) : "r,D,m" (min1));
}
// CHECK: @multi_A
-void multi_A()
+void multi_A(void)
{
// CHECK: asm "foo $1,$0", "=*r|A|m,r|A|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,A,m" (mout0) : "r,A,m" (min1));
}
// CHECK: @multi_f
-void multi_f()
+void multi_f(void)
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @multi_t
-void multi_t()
+void multi_t(void)
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @multi_u
-void multi_u()
+void multi_u(void)
{
//FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
}
// CHECK: @multi_y
-void multi_y()
+void multi_y(void)
{
// CHECK: asm "foo $1,$0", "=*r|y|m,r|y|m[[CLOBBERS]](double* elementtype(double) @dout0, double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,y,m" (dout0) : "r,y,m" (din1));
}
// CHECK: @multi_x
-void multi_x()
+void multi_x(void)
{
// CHECK: asm "foo $1,$0", "=*r|x|m,r|x|m[[CLOBBERS]](double* elementtype(double) @dout0, double {{[a-zA-Z0-9@%]+}})
asm("foo %1,%0" : "=r,x,m" (dout0) : "r,x,m" (din1));
}
// CHECK: @multi_Y
-void multi_Y0()
+void multi_Y0(void)
{
// Y constraint currently broken.
//asm("foo %1,%0" : "=r,Y0,m" (mout0) : "r,Y0,m" (min1));
}
// CHECK: @multi_I
-void multi_I()
+void multi_I(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|I|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,I,m" (1));
}
// CHECK: @multi_J
-void multi_J()
+void multi_J(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|J|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,J,m" (1));
}
// CHECK: @multi_K
-void multi_K()
+void multi_K(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|K|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,K,m" (1));
}
// CHECK: @multi_L
-void multi_L()
+void multi_L(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|L|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,L,m" (1));
}
// CHECK: @multi_M
-void multi_M()
+void multi_M(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|M|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,M,m" (1));
}
// CHECK: @multi_N
-void multi_N()
+void multi_N(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|N|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,N,m" (1));
}
// CHECK: @multi_G
-void multi_G()
+void multi_G(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|G|m[[CLOBBERS]](i32* elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,G,m" (1.0));
}
// CHECK: @multi_C
-void multi_C()
+void multi_C(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|C|m[[CLOBBERS]](i32* elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,C,m" (1.0));
}
// CHECK: @multi_e
-void multi_e()
+void multi_e(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|e|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,e,m" (1));
}
// CHECK: @multi_Z
-void multi_Z()
+void multi_Z(void)
{
// CHECK: asm "foo $1,$0", "=*r|m|m,r|Z|m[[CLOBBERS]](i32* elementtype(i32) @mout0, i32 1)
asm("foo %1,%0" : "=r,m,m" (mout0) : "r,Z,m" (1));
// CHECK: define{{.*}} i[[bits:[0-9]+]] @get_stack_pointer_addr()
// CHECK: [[ret:%[0-9]+]] = call i[[bits]] @llvm.read_register.i[[bits]](metadata !0)
// CHECK: ret i[[bits]] [[ret]]
-unsigned long get_stack_pointer_addr() {
+unsigned long get_stack_pointer_addr(void) {
return current_stack_pointer;
}
// CHECK: declare{{.*}} i[[bits]] @llvm.read_register.i[[bits]](metadata)
// CHECK: declare{{.*}} void @llvm.write_register.i[[bits]](metadata, i[[bits]])
// CHECK: define {{.*}}@fn1
-int fn1() {
+int fn1(void) {
return (*p4TH).word.len;
}
// CHECK: %[[regr:[0-9]+]] = call i[[bits]] @llvm.read_register.i[[bits]](metadata !0)
// STRICT-NOT: strict-float-cast-overflow
-int main() {
+int main(void) {
double d = 1e20;
return (int)d != 1e20 && (unsigned)d != 1e20;
}
// RUN: -emit-llvm -o - %s | FileCheck %s
int g(int);
-void __attribute__((no_profile_instrument_function)) no_instr() {
+void __attribute__((no_profile_instrument_function)) no_instr(void) {
// CHECK: define {{.*}}void @no_instr() [[ATTR:#[0-9]+]]
}
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fno-builtin -O1 -fexperimental-new-pass-manager -S -o - %s | FileCheck -check-prefix=NOSTRCPY -check-prefix=NOMEMSET %s
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fno-builtin-memset -O1 -fexperimental-new-pass-manager -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=NOMEMSET %s
-void PR13497() {
+void PR13497(void) {
char content[2];
// make sure we don't optimize this call to strcpy()
// STRCPY-NOT: __strcpy_chk
// CHECK-LABEL: main
// CHECK: attributes #0 = {{.*}}"no-trapping-math"="true"{{.*}}
-int main() {
+int main(void) {
return 0;
}
inline __attribute__ ((__always_inline__)) int inline_me(int a, int b) { return(a*b); }
volatile int *pa = (int*) 0x1000;
-void foo() {
+void foo(void) {
// NOINLINE: @foo
// NOINLINE: dont_inline_me
// NOINLINE-NOT: inlinehint
static int a;
// NULL-INVALID: define{{.*}} nonnull i32* @bar3()
// NULL-VALID: define{{.*}} i32* @bar3()
-int * bar3() __attribute__((returns_nonnull)) {
+int * bar3(void) __attribute__((returns_nonnull)) {
return &a;
}
// CHECK-NOPLT: Function Attrs: nonlazybind
// CHECK-NOPLT-NEXT: declare {{.*}}i32 @foo
// CHECK-NOPLT-METADATA: !"RtLibUseGOT"
-int foo();
+int foo(void);
-int bar() {
+int bar(void) {
return foo();
}
// CHECK-LABEL: main
// CHECK: attributes #0 = {{.*}}"no-jump-tables"="true"{{.*}}
-int main() {
+int main(void) {
return 0;
}
// RUN: %clang_cc1 -triple nvptx-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s
// RUN: %clang_cc1 -triple nvptx64-unknown-unknown -O3 -S -o - %s -emit-llvm | FileCheck %s
-void constraints() {
+void constraints(void) {
char c;
unsigned char uc;
short s;
int gi, gj;
// CHECK-LABEL: define{{.*}} void @test1
-void test1() {
+void test1(void) {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 4), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 59)
strcpy(&gbuf[4], "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test2
-void test2() {
+void test2(void) {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 63)
strcpy(gbuf, "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test3
-void test3() {
+void test3(void) {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 1, i64 37), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 0)
strcpy(&gbuf[100], "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test4
-void test4() {
+void test4(void) {
// CHECK: = call i8* @__strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 -1), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 0)
strcpy((char*)(void*)&gbuf[-1], "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test5
-void test5() {
+void test5(void) {
// CHECK: = load i8*, i8** @gp
// CHECK-NEXT:= call i64 @llvm.objectsize.i64.p0i8(i8* %{{.*}}, i1 false, i1 true, i1
strcpy(gp, "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test6
-void test6() {
+void test6(void) {
char buf[57];
// CHECK: = call i8* @__strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i64 53)
}
// CHECK-LABEL: define{{.*}} void @test7
-void test7() {
+void test7(void) {
int i;
// Ensure we only evaluate the side-effect once.
// CHECK: = add
}
// CHECK-LABEL: define{{.*}} void @test8
-void test8() {
+void test8(void) {
char *buf[50];
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
}
// CHECK-LABEL: define{{.*}} void @test9
-void test9() {
+void test9(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy((char *)((++gi) + gj), "Hi there");
// CHECK-LABEL: define{{.*}} void @test10
char **p;
-void test10() {
+void test10(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(*(++p), "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test11
-void test11() {
+void test11(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @gbuf, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(gp = gbuf, "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test12
-void test12() {
+void test12(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(++gp, "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test13
-void test13() {
+void test13(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(gp++, "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test14
-void test14() {
+void test14(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(--gp, "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test15
-void test15() {
+void test15(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{..*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(gp--, "Hi there");
}
// CHECK-LABEL: define{{.*}} void @test16
-void test16() {
+void test16(void) {
// CHECK-NOT: __strcpy_chk
// CHECK: = call i8* @__inline_strcpy_chk(i8* %{{.*}}, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
strcpy(gp += 1, "Hi there");
}
// CHECK-LABEL: @test17
-void test17() {
+void test17(void) {
// CHECK: store i32 -1
gi = OBJECT_SIZE_BUILTIN(gp++, 0);
// CHECK: store i32 -1
}
// CHECK-LABEL: @test19
-void test19() {
+void test19(void) {
struct {
int a, b;
} foo;
}
// CHECK-LABEL: @test20
-void test20() {
+void test20(void) {
struct { int t[10]; } t[10];
// CHECK: store i32 380
}
// CHECK-LABEL: @test21
-void test21() {
+void test21(void) {
struct { int t; } t;
// CHECK: store i32 0
}
// CHECK-LABEL: @test22
-void test22() {
+void test22(void) {
struct { int t[10]; } t[10];
// CHECK: store i32 0
// PR24493 -- ICE if OBJECT_SIZE_BUILTIN called with NULL and (Type & 1) != 0
// CHECK-LABEL: @test24
-void test24() {
+void test24(void) {
// CHECK: call i64 @llvm.objectsize.i64.p0i8(i8* {{.*}}, i1 false, i1 true, i1
gi = OBJECT_SIZE_BUILTIN((void*)0, 0);
// CHECK: call i64 @llvm.objectsize.i64.p0i8(i8* {{.*}}, i1 false, i1 true, i1
}
// CHECK-LABEL: @test25
-void test25() {
+void test25(void) {
// CHECK: call i64 @llvm.objectsize.i64.p0i8(i8* {{.*}}, i1 false, i1 true, i1
gi = OBJECT_SIZE_BUILTIN((void*)0x1000, 0);
// CHECK: call i64 @llvm.objectsize.i64.p0i8(i8* {{.*}}, i1 false, i1 true, i1
}
// CHECK-LABEL: @test26
-void test26() {
+void test26(void) {
struct { int v[10]; } t[10];
// CHECK: store i32 316
// The intent of this test is to ensure that OBJECT_SIZE_BUILTIN treats `&foo`
// and `(T*)&foo` identically, when used as the pointer argument.
// CHECK-LABEL: @test28
-void test28() {
+void test28(void) {
struct { int v[10]; } t[10];
#define addCasts(s) ((char*)((short*)(s)))
}
// CHECK-LABEL: @test30
-void test30() {
+void test30(void) {
struct { struct DynStruct1 fst, snd; } *nested;
// CHECK: call i64 @llvm.objectsize.i64.p0i8(i8* %{{.*}}, i1 false, i1 true, i1
}
// CHECK-LABEL: @test31
-void test31() {
+void test31(void) {
// Miscellaneous 'writing off the end' detection tests
struct DynStructVar *dsv;
struct DynStruct0 *ds0;
}
// CHECK-LABEL: @PR30346
-void PR30346() {
+void PR30346(void) {
struct sa_family_t {};
struct sockaddr {
struct sa_family_t sa_family;
extern char incomplete_char_array[];
// CHECK-LABEL: @incomplete_and_function_types
-int incomplete_and_function_types() {
+int incomplete_and_function_types(void) {
// CHECK: call i64 @llvm.objectsize.i64.p0i8
gi = OBJECT_SIZE_BUILTIN(incomplete_char_array, 0);
// CHECK: call i64 @llvm.objectsize.i64.p0i8
}
// Flips between the pointer and lvalue evaluator a lot.
-void deeply_nested() {
+void deeply_nested(void) {
struct {
struct {
struct {
enum e0 a:31;
};
-int f0() {
+int f0(void) {
return __builtin_omp_required_simd_align(struct s0);
// CHECK: ret i32 16
}
// RUN: not %clang_cc1 -O3 -triple x86_64-unknown-linux-gnu -target-cpu x86-64 %s -o %t -opt-record-file %t.yaml -opt-record-format "unknown-format" -emit-obj 2>&1 | FileCheck -check-prefix=CHECK-FORMAT-ERROR %s
// REQUIRES: x86-registered-target
-void bar();
-void foo() { bar(); }
+void bar(void);
+void foo(void) { bar(); }
void Test(int *res, int *c, int *d, int *p, int n) {
int i;
// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
// CHECK: _Z1fPA10_1X
-// CHECK: _Z1fPFvE
+// CHECK: _Z1fPFvvE
int __attribute__((overloadable)) f(int x) { return x; }
float __attribute__((overloadable)) f(float x) { return x; }
void __attribute__((overloadable)) f(int x, int y, ...) { }
-void __attribute__((overloadable)) f(void (*x)()) {}
+void __attribute__((overloadable)) f(void (*x)(void)) {}
-int main() {
+int main(void) {
int iv = 17;
float fv = 3.0f;
double dv = 4.0;
void addrof_single(char *a) __attribute__((overloadable));
// CHECK-LABEL: define {{(dso_local )?}}void @foo
-void foo() {
+void foo(void) {
// CHECK: store void (i8*)* @_Z11addrof_manyPc
void (*p1)(char *) = &addrof_many;
// CHECK: store void (i8*)* @_Z11addrof_manyPv
void ovl_bar(int) __attribute__((overloadable));
// CHECK-LABEL: define {{(dso_local )?}}void @bar
-void bar() {
+void bar(void) {
char charbuf[1];
unsigned char ucharbuf[1];
void ovl_baz2(int, int *) __attribute__((overloadable));
void ovl_baz2(unsigned int, unsigned int *) __attribute__((overloadable));
// CHECK-LABEL: define {{(dso_local )?}}void @baz
-void baz() {
+void baz(void) {
unsigned int j;
// Initial rules for incompatible pointer conversions made this overload
// ambiguous.
int x[6] PACKED;
};
-void use_X0() { struct X0 x0; x0.x[5] = sizeof(struct X0); };
+void use_X0(void) { struct X0 x0; x0.x[5] = sizeof(struct X0); };
// CHECK: Type: struct X1
struct X1 {
struct X0 y;
} PACKED;
-void use_X1() { struct X1 x1; x1.x[5] = sizeof(struct X1); };
+void use_X1(void) { struct X1 x1; x1.x[5] = sizeof(struct X1); };
// CHECK: Type: struct X2
struct PACKED X2 {
int y;
};
-void use_X2() { struct X2 x2; x2.y = sizeof(struct X2); };
+void use_X2(void) { struct X2 x2; x2.y = sizeof(struct X2); };
// CHECK: Type: struct X3
struct X3 {
int y;
};
-void use_X3() { struct X3 x3; x3.y = sizeof(struct X3); };
+void use_X3(void) { struct X3 x3; x3.y = sizeof(struct X3); };
#pragma pack(push,2)
// CHECK: Type: struct X4
};
#pragma pack(pop)
-void use_X4() { struct X4 x4; x4.y = sizeof(struct X4); };
+void use_X4(void) { struct X4 x4; x4.y = sizeof(struct X4); };
// CHECK: Type: struct X5
struct PACKED X5 { double a[19]; signed char b; };
-void use_X5() { struct X5 x5; x5.b = sizeof(struct X5); };
+void use_X5(void) { struct X5 x5; x5.b = sizeof(struct X5); };
// CHECK: Type: struct X6
struct PACKED X6 { long double a; char b; };
-void use_X6() { struct X6 x6; x6.b = sizeof(struct X6); };
+void use_X6(void) { struct X6 x6; x6.b = sizeof(struct X6); };
// CHECK: Type: struct X7
struct X7 {
unsigned char y;
} PACKED;
-void use_X7() { struct X7 x7; x7.y = x7.x = sizeof(struct X7); }
+void use_X7(void) { struct X7 x7; x7.y = x7.x = sizeof(struct X7); }
// CHECK: Type: union X8
union X8 {
int y : 29;
};
-void use_structs() {
+void use_structs(void) {
union X8 x8;
typedef int X8array[sizeof(union X8)];
x8.y = sizeof(union X8);
// CHECK: load double, double* {{.*}}, align 8
// CHECK: }
extern double g4[5] __attribute__((aligned(16)));
-double f4() {
+double f4(void) {
return g4[1];
}
struct X foo(void);
// <rdar://problem/10463337>
-struct X test1() {
+struct X test1(void) {
// CHECK: @test1
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* align 1 bitcast (%struct.X* getelementptr inbounds (%struct.Y, %struct.Y* @g, i32 0, i32 1) to i8*), i64 24, i1 false)
return g.y;
}
-struct X test2() {
+struct X test2(void) {
// CHECK: @test2
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* align 1 bitcast (%struct.X* getelementptr inbounds (%struct.Y, %struct.Y* @g, i32 0, i32 1) to i8*), i64 24, i1 false)
struct X a = g.y;
}
// <rdar://problem/10530444>
-void test4() {
+void test4(void) {
// CHECK: @test4
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* {{.*}}, i8* align 1 bitcast (%struct.X* getelementptr inbounds (%struct.Y, %struct.Y* @g, i32 0, i32 1) to i8*), i64 24, i1 false)
f(g.y);
}
// PR12395
-int test5() {
+int test5(void) {
// CHECK: @test5
// CHECK: load i32, i32* getelementptr inbounds (%struct.Y, %struct.Y* @g, i32 0, i32 1, i32 0, i64 0), align 1
return g.y.x[0];
}
// <rdar://problem/11220251>
-void test6() {
+void test6(void) {
// CHECK: @test6
// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 bitcast (%struct.X* getelementptr inbounds (%struct.Y, %struct.Y* @g, i32 0, i32 1) to i8*), i8* align 4 %{{.*}}, i64 24, i1 false)
g.y = foo();
} __attribute((packed));
struct YBitfield gbitfield;
-unsigned test7() {
+unsigned test7(void) {
// CHECK: @test7
// CHECK: load i32, i32* getelementptr inbounds (%struct.YBitfield, %struct.YBitfield* @gbitfield, i32 0, i32 1, i32 0), align 1
return gbitfield.y.b2;
};
struct TBitfield tbitfield;
-unsigned test9() {
+unsigned test9(void) {
// CHECK: @test9
// CHECK: load i16, i16* getelementptr inbounds (%struct.TBitfield, %struct.TBitfield* @tbitfield, i32 0, i32 2), align 1
return tbitfield.c;
// CHECK-NEXT: %[[B:[0-9+]]] = bitcast %struct.S* %s to i8*
// CHECK-NEXT: call void @llvm.memset{{.*}}(i8* align 8 %[[B]], i8 0,
// CHECK-NEXT: call void @use(%struct.S* noundef %s)
-void empty_braces() {
+void empty_braces(void) {
struct S s = {};
return use(&s);
}
// CHECK-NEXT: %[[B:[0-9+]]] = bitcast %struct.S* %s to i8*
// CHECK-NEXT: call void @llvm.memcpy{{.*}}(i8* align 8 %[[B]], {{.*}}@__const.partial_init.s
// CHECK-NEXT: call void @use(%struct.S* noundef %s)
-void partial_init() {
+void partial_init(void) {
struct S s = { .c = 42 };
return use(&s);
}
// CHECK-NEXT: %[[B:[0-9+]]] = bitcast %struct.S* %s to i8*
// CHECK-NEXT: call void @llvm.memcpy{{.*}}(i8* align 8 %[[B]], {{.*}}@__const.init_all.s
// CHECK-NEXT: call void @use(%struct.S* noundef %s)
-void init_all() {
+void init_all(void) {
struct S s = { .c = 42, .l = 0xdeadbeefc0fedead };
return use(&s);
}
}
// CHECK-LABEL: get235
-struct P2 get235()
+struct P2 get235(void)
{
struct P2 p = { 2, 3, 5 };
return p;
}
// CHECK-LABEL: get456789
-struct LP2P2 get456789()
+struct LP2P2 get456789(void)
{
struct LP2P2 l = { { 4, 5, 6 }, { 7, 8, 9 } };
return l;
}
// CHECK-LABEL: get123
-union UP2 get123()
+union UP2 get123(void)
{
union UP2 u = { { 1, 2, 3 } };
return u;
// PR8856 - -fshort-wchar makes wchar_t be unsigned.
// CHECK: @test2
// CHECK: store volatile i32 1, i32* %isUnsigned
-void test2() {
+void test2(void) {
volatile int isUnsigned = (wchar_t)-1 > (wchar_t)0;
}
}
// CHECK-LABEL: define{{.*}} void @test3
-void test3() {
+void test3(void) {
struct Foo t[10];
// CHECK: call i32 @_Z27NoViableOverloadObjectSize0PvU17pass_object_size0(i8* noundef %{{.*}}, i64 noundef 360)
gi = NoViableOverloadObjectSize3(&t[1].t[1]);
}
-void test5() {
+void test5(void) {
struct Foo t[10];
int (*f)(void *) = &NoViableOverloadObjectSize0;
__attribute__((overloadable)) __asm__("OverloadNoSize");
// CHECK-LABEL: define{{.*}} void @test6
-void test6() {
+void test6(void) {
int known[10], *opaque;
// CHECK: call i32 @"\01Overload0"
int AsmObjectSize3(void *const p PS(3)) __asm__("Identity");
// CHECK-LABEL: define{{.*}} void @test7
-void test7() {
+void test7(void) {
struct Foo t[10];
// CHECK: call i32 @"\01Identity"(i8* noundef %{{.*}}, i64 noundef 360)
}
// CHECK-LABEL: define{{.*}} void @test13
-void test13() {
+void test13(void) {
char c[10];
unsigned i = 0;
char *p = c;
// RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -fms-hotpatch -o - | FileCheck --check-prefixes=HOTPATCH %s
// CHECK: define{{.*}} void @f0() #0
-__attribute__((patchable_function_entry(0))) void f0() {}
+__attribute__((patchable_function_entry(0))) void f0(void) {}
// CHECK: define{{.*}} void @f00() #0
-__attribute__((patchable_function_entry(0, 0))) void f00() {}
+__attribute__((patchable_function_entry(0, 0))) void f00(void) {}
// CHECK: define{{.*}} void @f2() #1
-__attribute__((patchable_function_entry(2))) void f2() {}
+__attribute__((patchable_function_entry(2))) void f2(void) {}
// CHECK: define{{.*}} void @f20() #1
-__attribute__((patchable_function_entry(2, 0))) void f20() {}
+__attribute__((patchable_function_entry(2, 0))) void f20(void) {}
// CHECK: define{{.*}} void @f20decl() #1
-__attribute__((patchable_function_entry(2, 0))) void f20decl();
-void f20decl() {}
+__attribute__((patchable_function_entry(2, 0))) void f20decl(void);
+void f20decl(void) {}
// CHECK: define{{.*}} void @f44() #2
-__attribute__((patchable_function_entry(4, 4))) void f44() {}
+__attribute__((patchable_function_entry(4, 4))) void f44(void) {}
// CHECK: define{{.*}} void @f52() #3
-__attribute__((patchable_function_entry(5, 2))) void f52() {}
+__attribute__((patchable_function_entry(5, 2))) void f52(void) {}
// OPT: define{{.*}} void @f() #4
-void f() {}
+void f(void) {}
/// No need to emit "patchable-function-entry"="0"
// CHECK: attributes #0 = { {{.*}}
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm %s -o - | FileCheck %s -check-prefix=NO-SKIP
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -mskip-rax-setup -emit-llvm %s -o - | FileCheck %s -check-prefix=SKIP
-void f() {}
+void f(void) {}
// SKIP: !"SkipRaxSetup", i32 1}
// NO-SKIP-NOT: "SkipRaxSetup"
// RUN: %clang_cc1 -fms-extensions %s -triple=x86_64-unknown-unknown -emit-llvm -o - | FileCheck %s --check-prefix=X64
typedef int v4si __attribute__ ((vector_size (16)));
-v4si rep() {
+v4si rep(void) {
// X86-LABEL: define{{.*}} <4 x i32> @rep
// X86: %[[ALLOCA0:.*]] = alloca <4 x i32>, align 16
// X86: %[[ALLOCA1:.*]] = alloca <4 x i32>, align 16
#pragma GCC visibility pop
#pragma GCC visibility push(hidden)
-void f() {}
+void f(void) {}
// CHECK-LABEL: define hidden void @f
-__attribute((visibility("default"))) void g();
-void g() {}
+__attribute((visibility("default"))) void g(void);
+void g(void) {}
// CHECK-LABEL: define{{.*}} void @g
///////////// PR10878: Make sure we can call a weak alias
void SHA512Pad(void *context) {}
#pragma weak SHA384Pad = SHA512Pad
-void PR10878() { SHA384Pad(0); }
+void PR10878(void) { SHA384Pad(0); }
// CHECK: call void @SHA384Pad(i8* noundef null)
// PR14046: Parse #pragma weak in function-local context
extern int PR14046e(void);
-void PR14046f() {
+void PR14046f(void) {
#pragma weak PR14046e
PR14046e();
}
// RUN: %clang_cc1 -fms-extensions %s -triple %itanium_abi_triple -emit-llvm -o - | FileCheck %s
// CHECK: @__func__.plainFunction = private unnamed_addr constant [14 x i8] c"plainFunction\00"
-// CHECK: @__PRETTY_FUNCTION__.plainFunction = private unnamed_addr constant [21 x i8] c"void plainFunction()\00"
+// CHECK: @__PRETTY_FUNCTION__.plainFunction = private unnamed_addr constant [25 x i8] c"void plainFunction(void)\00"
// CHECK: @__func__.externFunction = private unnamed_addr constant [15 x i8] c"externFunction\00"
-// CHECK: @__PRETTY_FUNCTION__.externFunction = private unnamed_addr constant [22 x i8] c"void externFunction()\00"
+// CHECK: @__PRETTY_FUNCTION__.externFunction = private unnamed_addr constant [26 x i8] c"void externFunction(void)\00"
// CHECK: @__func__.privateExternFunction = private unnamed_addr constant [22 x i8] c"privateExternFunction\00"
-// CHECK: @__PRETTY_FUNCTION__.privateExternFunction = private unnamed_addr constant [29 x i8] c"void privateExternFunction()\00"
+// CHECK: @__PRETTY_FUNCTION__.privateExternFunction = private unnamed_addr constant [33 x i8] c"void privateExternFunction(void)\00"
// CHECK: @__func__.__captured_stmt = private unnamed_addr constant [25 x i8] c"functionWithCapturedStmt\00"
-// CHECK: @__PRETTY_FUNCTION__.__captured_stmt = private unnamed_addr constant [32 x i8] c"void functionWithCapturedStmt()\00"
+// CHECK: @__PRETTY_FUNCTION__.__captured_stmt = private unnamed_addr constant [36 x i8] c"void functionWithCapturedStmt(void)\00"
// CHECK: @__func__.staticFunction = private unnamed_addr constant [15 x i8] c"staticFunction\00"
-// CHECK: @__PRETTY_FUNCTION__.staticFunction = private unnamed_addr constant [22 x i8] c"void staticFunction()\00"
+// CHECK: @__PRETTY_FUNCTION__.staticFunction = private unnamed_addr constant [26 x i8] c"void staticFunction(void)\00"
int printf(const char *, ...);
-void plainFunction() {
+void plainFunction(void) {
printf("__func__ %s\n", __func__);
printf("__FUNCTION__ %s\n", __FUNCTION__);
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
}
-extern void externFunction() {
+extern void externFunction(void) {
printf("__func__ %s\n", __func__);
printf("__FUNCTION__ %s\n", __FUNCTION__);
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
}
-__private_extern__ void privateExternFunction() {
+__private_extern__ void privateExternFunction(void) {
printf("__func__ %s\n", __func__);
printf("__FUNCTION__ %s\n", __FUNCTION__);
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
}
-void functionWithCapturedStmt() {
+void functionWithCapturedStmt(void) {
#pragma clang __debug captured
{
printf("__func__ %s\n", __func__);
}
}
-static void staticFunction() {
+static void staticFunction(void) {
printf("__func__ %s\n", __func__);
printf("__FUNCTION__ %s\n", __FUNCTION__);
printf("__PRETTY_FUNCTION__ %s\n\n", __PRETTY_FUNCTION__);
}
-int main() {
+int main(void) {
plainFunction();
externFunction();
privateExternFunction();
// Check that the preserve_most calling convention attribute at the source level
// is lowered to the corresponding calling convention attrribute at the LLVM IR
// level.
-void foo() __attribute__((preserve_most)) {
+void foo(void) __attribute__((preserve_most)) {
// CHECK-LABEL: define {{(dso_local )?}}preserve_mostcc void @foo()
}
// Check that the preserve_most calling convention attribute at the source level
// is lowered to the corresponding calling convention attrribute at the LLVM IR
// level.
-void boo() __attribute__((preserve_all)) {
+void boo(void) __attribute__((preserve_all)) {
// CHECK-LABEL: define {{(dso_local )?}}preserve_allcc void @boo()
}
void bar(int);
-void foo() {
+void foo(void) {
bar(I);
}
// SECTION: @test1
// EXCLUDE: noprofile
// EXCLUDE: @test1
-unsigned test1() {
+unsigned test1(void) {
// CHECK: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_test1, i32 0, i32 0)
// FUNC: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_test1, i32 0, i32 0)
// FILE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_test1, i32 0, i32 0)
// SECTION: @test2
// EXCLUDE-NOT: noprofile
// EXCLUDE: @test2
-unsigned test2() {
+unsigned test2(void) {
// CHECK: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_test2, i32 0, i32 0)
// FUNC-NOT: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_test2, i32 0, i32 0)
// FILE: %pgocount = load i64, i64* getelementptr inbounds ([1 x i64], [1 x i64]* @__profc_test2, i32 0, i32 0)
// CHECK: define{{.*}} void @foo()
// CHECK: attributes{{.*}} "profile-sample-accurate"
-void foo() {
+void foo(void) {
}
__declspec(dllimport) int import_int;
-__declspec(dllexport) void export_declared_function();
+__declspec(dllexport) void export_declared_function(void);
-__declspec(dllexport) void export_implemented_function() {
+__declspec(dllexport) void export_implemented_function(void) {
}
__declspec(dllimport) void import_function(int);
-void call_imported_function() {
+void call_imported_function(void) {
export_declared_function();
return import_function(import_int);
}
// Check the generation of pseudoprobe intrinsic call
-void bar();
-void go();
+void bar(void);
+void go(void);
void foo(int x) {
// CHECK: call void @llvm.pseudoprobe(i64 [[#GUID:]], i64 1, i32 0, i64 -1)
int name;
// __PRAGMA_REDEFINE_EXTNAME should be defined. This will fail if it isn't...
-int fish() { return fake() + __PRAGMA_REDEFINE_EXTNAME + name; }
+int fish(void) { return fake() + __PRAGMA_REDEFINE_EXTNAME + name; }
// Check that the call to fake() is emitted as a call to real()
// CHECK: call i32 @real()
// Check that this also works with variables names
// This is a case when redefenition is deferred *and* we have a local of the
// same name. PR23923.
#pragma redefine_extname foo bar
-int f() {
+int f(void) {
int foo = 0;
return foo;
}
-extern int foo() { return 1; }
+extern int foo(void) { return 1; }
// CHECK: define{{.*}} i32 @bar()
// Check that pragma redefine_extname applies to external declarations only.
#pragma redefine_extname foo_static bar_static
-static int foo_static() { return 1; }
-int baz() { return foo_static(); }
+static int foo_static(void) { return 1; }
+int baz(void) { return foo_static(); }
// CHECK-NOT: call i32 @bar_static()
// Check that pragma redefine_extname applies to builtin functions.
void f2(int a, int b) __attribute((regparm(0)));
-void f0() {
+void f0(void) {
// CHECK: call void @f1(i32 inreg noundef 1, i32 inreg noundef 2, i32 inreg noundef 3, i32 inreg noundef 4,
// CHECK: i32 noundef 5, i32 noundef 6, i32 noundef 7, i32 noundef 8)
f1(1, 2, 3, 4, 5, 6, 7, 8);
__attribute__((regparm(3))) void f1(int a, int b, int c, int d);
// CHECK: declare void @f1(i32 inreg noundef, i32 inreg noundef, i32 inreg noundef, i32 noundef)
-void g1() {
+void g1(void) {
f1(41, 42, 43, 44);
}
};
__attribute__((regparm(3))) void f2(int a, int b, struct s1 c, int d);
// CHECK: declare void @f2(i32 inreg noundef, i32 inreg noundef, i32 inreg, i32 noundef)
-void g2() {
+void g2(void) {
struct s1 x = {43};
f2(41, 42, x, 44);
}
};
__attribute__((regparm(3))) void f3(int a, int b, struct s2 c, int d);
// CHECK: declare void @f3(i32 inreg noundef, i32 inreg noundef, i32, i32, i32 noundef)
-void g3() {
+void g3(void) {
struct s2 x = {43, 44};
f3(41, 42, x, 45);
}
__attribute__((regparm(3))) void f4(int a, struct s2 b, int c);
// CHECK: declare void @f4(i32 inreg noundef, i32 inreg, i32 inreg, i32 noundef)
-void g4() {
+void g4(void) {
struct s2 x = {42, 43};
f4(41, x, 44);
}
};
__attribute__((regparm(3))) void f5(int a, struct s3 b, int c);
// CHECK: declare void @f5(i32 inreg noundef, i32, i32, i32, i32 noundef)
-void g5() {
+void g5(void) {
struct s3 x = {42, 43, 44};
f5(41, x, 45);
}
__attribute__((regparm(3))) void f6(struct s3 a, int b);
// CHECK: declare void @f6(i32 inreg, i32 inreg, i32 inreg, i32 noundef)
-void g6() {
+void g6(void) {
struct s3 x = {41, 42, 43};
f6(x, 44);
}
};
__attribute__((regparm(3))) void f7(struct s4 a, int b);
// CHECK: declare void @f7(i32, i32, i32, i32, i32 noundef)
-void g7() {
+void g7(void) {
struct s4 x = {41, 42, 43, 44};
f7(x, 45);
}
// CHECK-RS32: [3 x i8] @retChar3()
// CHECK-RS64: [3 x i8] @retChar3()
-sChar3 retChar3() { sChar3 r; return r; }
+sChar3 retChar3(void) { sChar3 r; return r; }
// CHECK-RS32: [2 x i16] @retShortChar()
// CHECK-RS64: [2 x i16] @retShortChar()
-sShortChar retShortChar() { sShortChar r; return r; }
+sShortChar retShortChar(void) { sShortChar r; return r; }
// =============================================================================
// aggregate parameter <= 16 bytes: coerced to [a x iNN] for both 32-bit and
// CHECK-RS32: void @retShortCharShort(%struct.sShortCharShort* noalias sret(%struct.sShortCharShort) align 2 %agg.result)
// CHECK-RS64: [3 x i16] @retShortCharShort()
-sShortCharShort retShortCharShort() { sShortCharShort r; return r; }
+sShortCharShort retShortCharShort(void) { sShortCharShort r; return r; }
// CHECK-RS32: void @retIntShortChar(%struct.sIntShortChar* noalias sret(%struct.sIntShortChar) align 4 %agg.result)
// CHECK-RS64: [2 x i32] @retIntShortChar()
-sIntShortChar retIntShortChar() { sIntShortChar r; return r; }
+sIntShortChar retIntShortChar(void) { sIntShortChar r; return r; }
// CHECK-RS32: void @retLongInt(%struct.sLongInt* noalias sret(%struct.sLongInt) align 8 %agg.result)
// CHECK-RS64: [2 x i64] @retLongInt()
-sLongInt retLongInt() { sLongInt r; return r; }
+sLongInt retLongInt(void) { sLongInt r; return r; }
// =============================================================================
// aggregate parameter <= 64 bytes: coerced to [a x iNN] for 32-bit RenderScript
// CHECK-RS32: void @retInt5(%struct.sInt5* noalias sret(%struct.sInt5) align 4 %agg.result)
// CHECK-RS64: void @retInt5(%struct.sInt5* noalias sret(%struct.sInt5) align 4 %agg.result)
-sInt5 retInt5() { sInt5 r; return r;}
+sInt5 retInt5(void) { sInt5 r; return r;}
// CHECK-RS32: void @retLong2Char(%struct.sLong2Char* noalias sret(%struct.sLong2Char) align 8 %agg.result)
// CHECK-RS64: void @retLong2Char(%struct.sLong2Char* noalias sret(%struct.sLong2Char) align 8 %agg.result)
-sLong2Char retLong2Char() { sLong2Char r; return r;}
+sLong2Char retLong2Char(void) { sLong2Char r; return r;}
// =============================================================================
// aggregate parameters and return values > 64 bytes: passed and returned on the
// CHECK-RS32: void @retLong9(%struct.sLong9* noalias sret(%struct.sLong9) align 8 %agg.result)
// CHECK-RS64: void @retLong9(%struct.sLong9* noalias sret(%struct.sLong9) align 8 %agg.result)
-sLong9 retLong9() { sLong9 r; return r; }
+sLong9 retLong9(void) { sLong9 r; return r; }
};
static struct S var_01 = {0x1.000001p0};
-struct S *func_01() {
+struct S *func_01(void) {
return &var_01;
}
struct S var_02 = {0x1.000001p0};
-struct S *func_03() {
+struct S *func_03(void) {
static struct S var_03 = {0x1.000001p0};
return &var_03;
}
#pragma STDC FENV_ROUND FE_UPWARD
static struct S var_04 = {0x1.000001p0};
-struct S *func_04() {
+struct S *func_04(void) {
return &var_04;
}
struct S var_05 = {0x1.000001p0};
-struct S *func_06() {
+struct S *func_06(void) {
static struct S var_06 = {0x1.000001p0};
return &var_06;
}
_Atomic(unsigned) atomic;
// CHECK-LABEL: define{{.*}} void @cmpd_assign
-void cmpd_assign() {
+void cmpd_assign(void) {
// CHECK: br label %[[LOOP_START:.*]]
// CHECK: [[LOOP_START]]:
}
// CHECK-LABEL: define{{.*}} void @inc
-void inc() {
+void inc(void) {
// CHECK: br label %[[LOOP_START:.*]]
// CHECK: [[LOOP_START]]:
// RECOVER: @test
// ABORT: @test
-void test() {
+void test(void) {
extern volatile unsigned x, y, z;
// RECOVER: uadd.with.overflow.i32{{.*}}, !nosanitize
x = y + z;
}
-void foo() {
+void foo(void) {
union { int i; } u;
u.i=1;
// PARTIAL: %[[SIZE:.*]] = call i64 @llvm.objectsize.i64.p0i8(i8* {{.*}}, i1 false, i1 false)
for (d = g->c;;)
;
}
-void h() { f(e); }
+void h(void) { f(e); }
// CHECK: Running pass: {{.*}}SanitizerPass
// CHECK-NOT: Running pass: LoopSimplifyPass on {{.*}}san.module_ctor
// SANITIZED: @overflow
// UNSANITIZED: @overflow
-unsigned overflow() {
+unsigned overflow(void) {
// SANITIZED: call {{.*}}void @__ubsan
// UNSANITIZED-NOT: call {{.*}}void @__ubsan
return i * 37;
// SANITIZED: @cfi
// UNSANITIZED: @cfi
-void cfi(void (*fp)()) {
+void cfi(void (*fp)(void)) {
// SANITIZED: llvm.type.test
// UNSANITIZED-NOT: llvm.type.test
fp();
int func(void) { return 0; }
int ext(void);
-static void *ifunc_resolver() { return func; }
+static void *ifunc_resolver(void) { return func; }
-int foo() {
+int foo(void) {
return var + ext_var + ifunc() + func() + ext();
}
// CHECK-DEFAULT: declare i32 @func()
int func(void);
-int use() {
+int use(void) {
return var_hidden + var_protected + var_default + var +
func_hidden() + func_protected() + func_default() + func();
}
}
#endif
-void f() {
+void f(void) {
jmp_buf jb;
// CHECK: call {{.*}}@setjmp(
setjmp(jb);
char *globalStringArray[5] = { "123", "abc" };
char *anotherGlobalString = "123";
-int main() {
+int main(void) {
printf("123");
}
// CHECK: declare void @f1_helper(%struct.s1* noundef byval(%struct.s1) align 8)
void f1_helper(struct s1);
-void f1() {
+void f1(void) {
f1_helper(x1);
}
// CHECK: %[[XV:[^ ]+]] = zext i8 %{{[^ ]+}} to i64
// CHECK: %[[HB:[^ ]+]] = shl i64 %[[XV]], 56
// CHECK: = call i64 @f_tiny(i64 %[[HB]])
-void call_tiny() {
+void call_tiny(void) {
struct tiny x = { 1 };
f_tiny(x);
}
// RUN: %clang_cc1 -triple sparcv9-unknown-unknown -emit-llvm %s -o - | FileCheck %s
static unsigned char dwarf_reg_size_table[102+1];
-int test() {
+int test(void) {
__builtin_init_dwarf_reg_size_table(dwarf_reg_size_table);
return __builtin_dwarf_sp_column();
// RUN: %clang_cc1 -triple x86_64-unknown-linux -debug-info-kind=limited -dwarf-version=5 -split-dwarf-file foo.dwo -split-dwarf-output %t -emit-obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck --check-prefix=DWARFv5 %s
// RUN: llvm-dwarfdump -debug-info %t | FileCheck --check-prefix=DWARFv5 %s
-int f() { return 0; }
+int f(void) { return 0; }
// DWARFv4: DW_AT_GNU_dwo_name ("foo.dwo")
// DWARFv5: DW_AT_dwo_name ("foo.dwo")
// ; Check that regular LTO has EnableSplitLTOUnit = 1
// RUN: %clang_cc1 -flto -triple x86_64-pc-linux-gnu -emit-llvm-bc < %s | llvm-dis -o - | FileCheck %s --implicit-check-not="EnableSplitLTOUnit" --check-prefix=SPLIT
-int main() {}
+int main(void) {}
// RUN: %clang -target x86_64-linux-gnu -fsplit-stack -S %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-SEGSTK %s
// RUN: %clang -target x86_64-linux-gnu -S %s -emit-llvm -o - | FileCheck -check-prefix=CHECK-NOSEGSTK %s
-int foo() {
+int foo(void) {
return 0;
}
__attribute__((no_split_stack))
-int nosplit() {
+int nosplit(void) {
return 0;
}
-int main() {
+int main(void) {
return foo();
}
// NO-STACKPROBE: attributes #{{[0-9]+}} = {{{.*}} "no-stack-arg-probe"
// STACKPROBE-NOT: "no-stack-arg-probe"
-void test1() {
+void test1(void) {
}
// RUN: %clang_cc1 -triple powerpc64-linux-gnu -O0 -S -emit-llvm -o- %s -fstack-clash-protection | FileCheck %s
// CHECK: define{{.*}} void @large_stack() #[[A:.*]] {
-void large_stack() {
+void large_stack(void) {
volatile int stack[20000], i;
for (i = 0; i < sizeof(stack) / sizeof(int); ++i)
stack[i] = i;
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fstack-size-section %s -S -o - | FileCheck %s --check-prefix=CHECK-PRESENT
// CHECK-PRESENT: section .stack_sizes
-int foo() { return 42; }
+int foo(void) { return 42; }
// REALIGN: attributes #{{[0-9]+}} = {{{.*}} "stackrealign"
// NO-REALIGN-NOT: attributes #{{[0-9]+}} = {{{.*}} "stackrealign"
-void test1() {
+void test1(void) {
}
// RUN: %clang_cc1 -emit-llvm < %s
-int a() {static union{int a;} r[2] = {1,2};return r[1].a;}
+int a(void) {static union{int a;} r[2] = {1,2};return r[1].a;}
10
};
-void *f()
+void *f(void)
{
if (a.a)
return v;
double d;
};
-void f() {
+void f(void) {
static int i = 42;
static int is[] = { 1, 2, 3, 4 };
static char* str = "forty-two";
static struct AStruct myStruct = { 1, "two", 3.0 };
}
-void g() {
+void g(void) {
static char a[10];
static char *b = a;
}
typedef __WCHAR_TYPE__ wchar_t;
-int main() {
+int main(void) {
// This should convert to utf8.
// CHECK: private unnamed_addr constant [10 x i8] c"\E1\84\A0\C8\A0\F4\82\80\B0\00", align 1
char b[10] = "\u1120\u0220\U00102030";
#ifdef __cplusplus
extern "C"
#endif
-void f() {
+void f(void) {
// CHECK-C: private unnamed_addr constant [6 x i8] c"\C0\E9\EE\F5\FC\00", align 1
// CHECK-CPP0X: private unnamed_addr constant [6 x i8] c"\C0\E9\EE\F5\FC\00", align 1
char const *aa = "Àéîõü";
typedef __CHAR32_TYPE__ char32_t;
#endif
-int main() {
+int main(void) {
// CHECK-C: private unnamed_addr constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1
// CHECK-C11: private unnamed_addr constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1
// CHECK-CXX11: private unnamed_addr constant [10 x i8] c"abc\00\00\00\00\00\00\00", align 1
// rdar://8183908
typedef unsigned int uint32_t;
typedef __attribute__((neon_vector_type(2))) uint32_t uint32x2_t;
-void foo() {
+void foo(void) {
const uint32x2_t signBit = { (uint2) 0x80000000 };
}
#include <stdarg.h>
-extern void abort() __attribute__((noreturn));
+extern void abort(void) __attribute__((noreturn));
struct tiny {
char c;
// ARM-NOT: %{{[0-9]+}} = getelementptr inbounds i8, i8* %argp.cur, i32 3
}
-void foo() {
+void foo(void) {
struct tiny x[3];
union data y;
x[0].c = 10;
int y;
} point;
-void fn1() {
+void fn1(void) {
point.x = 42;
}
} p1;
} point2;
-void fn2() {
+void fn2(void) {
point2.p1.a = 42;
}
int data;
struct NA *next;
} NA;
-void f1() { NA a; }
+void f1(void) { NA a; }
typedef struct NB {
int d1;
} B2;
} NB;
-void f2() { NB b; }
+void f2(void) { NB b; }
-extern NB *f3();
-void f4() {
+extern NB *f3(void);
+void f4(void) {
f3()->d1 = 42;
}
-void f5() {
+void f5(void) {
(f3())->d1 = 42;
}
int location;
int length;
} range;
-extern range f6();
-void f7() {
+extern range f6(void);
+void f7(void) {
range r = f6();
}
range range2;
} rangepair;
-void f8() {
+void f8(void) {
rangepair p;
range r = p.range1;
int a;
} a;
-void f11() {
+void f11(void) {
struct _a a1;
a a2;
}
/* Implicit casts (due to const) */
-void f12() {
+void f12(void) {
struct _a a1;
const struct _a a2;
int a16(void) {c15.a = 1;}
/* compound literals */
-void f13() {
+void f13(void) {
a13 x; x = (a13){1,2};
}
/* As lvalue */
-int f15() {
- extern range f15_ext();
+int f15(void) {
+ extern range f15_ext(void);
return f15_ext().location;
}
-range f16() {
- extern rangepair f16_ext();
+range f16(void) {
+ extern rangepair f16_ext(void);
return f16_ext().range1;
}
-int f17() {
- extern range f17_ext();
+int f17(void) {
+ extern range f17_ext(void);
range r;
return (r = f17_ext()).location;
}
-range f18() {
- extern rangepair f18_ext();
+range f18(void) {
+ extern rangepair f18_ext(void);
rangepair rp;
return (rp = f18_ext()).range1;
}
// CHECK-NOT: @dead
// CHECK: ret void
int i;
-void dead();
+void dead(void);
-void test1() {
+void test1(void) {
switch (1)
case 1:
++i;
// CHECK-NOT: switch
// CHECK-NOT: @dead
// CHECK: ret void
-void test2() {
+void test2(void) {
switch (4) {
case 1:
dead();
// CHECK-NOT: switch
// CHECK-NOT: @dead
// CHECK: ret void
-void test3() {
+void test3(void) {
switch (4) {
case 1:
dead();
// CHECK-NOT: switch
// CHECK-NOT: @dead
// CHECK: ret void
-void test4() {
+void test4(void) {
switch (4) {
case 1:
dead();
// This shouldn't crash codegen, but we don't have to optimize out the switch
// in this case.
-void test5() {
+void test5(void) {
switch (1) {
int x; // eliding var decl?
case 1:
// CHECK-NOT: switch
// CHECK-NOT: @dead
// CHECK: ret void
-void test6() {
+void test6(void) {
// Neither case is reachable.
switch (40) {
case 1:
// CHECK-NOT: switch
// CHECK-NOT: @dead
// CHECK: ret void
-void test7() {
+void test7(void) {
switch (4) {
case 1:
dead();
// CHECK-NOT: switch
// CHECK-NOT: @dead
// CHECK: ret void
-void test8() {
+void test8(void) {
switch (4) {
case 1:
dead();
// CHECK: @test11
// CHECK-NOT: switch
// CHECK: ret void
-void test11() {
+void test11(void) {
switch (1) {
case 1:
break;
// CHECK: @test12
// CHECK-NOT: switch
// CHECK: ret void
-void test12() {
+void test12(void) {
switch (1) {
case 2: {
int a; // Ok to skip this vardecl.
// CHECK-LABEL: define{{.*}} i32 @foo4t()
// CHECK: ret i32 376
// CHECK: }
-int foo4t() {
+int foo4t(void) {
// 111 + 1 + 222 + 42 = 376
return foo4(111) + foo4(99) + foo4(222) + foo4(601);
}
// CHECK-LABEL: define{{.*}} void @foo5()
// CHECK-NOT: switch
// CHECK: }
-void foo5(){
+void foo5(void){
switch(0){
default:
if (0) {
// CHECK-LABEL: define{{.*}} void @foo6()
// CHECK-NOT: switch
// CHECK: }
-void foo6(){
+void foo6(void){
switch(0){
}
}
// CHECK-LABEL: define{{.*}} void @foo7()
// CHECK-NOT: switch
// CHECK: }
-void foo7(){
+void foo7(void){
switch(0){
foo7();
}
return 10;
}
}
-int f9() {
+int f9(void) {
return f9_0(2);
}
}
}
-int f10() {
+int f10(void) {
f10_0(1);
return 10;
}
};
extern volatile char gc;
void SYSV_CC take_stringref(struct StringRef s);
-void callit() {
+void callit(void) {
struct StringRef s = {"asdf", 4};
take_stringref(s);
}
my_m512 SYSV_CC get_m512(void);
void SYSV_CC take_m512(my_m512);
-void use_vectors() {
+void use_vectors(void) {
my_m256 v1 = get_m256();
take_m256(v1);
my_m512 v2 = get_m512();