aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/function-attributes.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/function-attributes.c')
-rw-r--r--test/CodeGen/function-attributes.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/function-attributes.c b/test/CodeGen/function-attributes.c
new file mode 100644
index 0000000000..bb482a043d
--- /dev/null
+++ b/test/CodeGen/function-attributes.c
@@ -0,0 +1,22 @@
+// RUN: clang -emit-llvm -o %t.clang.ll %s &&
+// RUN: %llvmgcc -c --emit-llvm -o - %s | llvm-dis -f -o %t.gcc.ll &&
+// RUN: grep "define" %t.clang.ll | sort > %t.clang.defs &&
+// RUN: grep "define" %t.gcc.ll | sort > %t.gcc.defs &&
+// RUN: diff %t.clang.defs %t.gcc.defs
+
+signed char f0(int x) { return x; }
+
+unsigned char f1(int x) { return x; }
+
+void f2(signed char x) { }
+
+void f3(unsigned char x) { }
+
+signed short f4(int x) { return x; }
+
+unsigned short f5(int x) { return x; }
+
+void f6(signed short x) { }
+
+void f7(unsigned short x) { }
+