diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/CodeGen/overloadable.c | 24 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/mangle.cpp | 9 |
2 files changed, 33 insertions, 0 deletions
diff --git a/clang/test/CodeGen/overloadable.c b/clang/test/CodeGen/overloadable.c new file mode 100644 index 00000000000..6b1cb351e63 --- /dev/null +++ b/clang/test/CodeGen/overloadable.c @@ -0,0 +1,24 @@ +// RUN: clang -emit-llvm %s -o - | grep _Z1fPA10_1X +int __attribute__((overloadable)) f(int x) { return x; } +float __attribute__((overloadable)) f(float x) { return x; } +double __attribute__((overloadable)) f(double x) { return x; } +double _Complex __attribute__((overloadable)) f(double _Complex x) { return x; } +typedef short v4hi __attribute__ ((__vector_size__ (8))); +v4hi __attribute__((overloadable)) f(v4hi x) { return x; } + +struct X { }; +void __attribute__((overloadable)) f(struct X (*ptr)[10]) { } + +int main() { + int iv = 17; + float fv = 3.0f; + double dv = 4.0; + double _Complex cdv; + v4hi vv; + + iv = f(iv); + fv = f(fv); + dv = f(dv); + cdv = f(cdv); + vv = f(vv); +} diff --git a/clang/test/CodeGenCXX/mangle.cpp b/clang/test/CodeGenCXX/mangle.cpp new file mode 100644 index 00000000000..7b92c85046f --- /dev/null +++ b/clang/test/CodeGenCXX/mangle.cpp @@ -0,0 +1,9 @@ +// RUN: clang -emit-llvm %s -o - | grep _ZplRK1YRA100_P1X + +// FIXME: This test is intentionally trivial, because we can't yet +// CodeGen anything real in C++. +struct X { }; +struct Y { }; + +bool operator+(const Y&, X* (&xs)[100]) { return false; } + |