diff options
Diffstat (limited to 'test/Frontend')
-rw-r--r-- | test/Frontend/ast-main.cpp | 22 | ||||
-rw-r--r-- | test/Frontend/dependency-gen-escaping.c | 17 | ||||
-rw-r--r-- | test/Frontend/hexagon-target-basic.c | 9 | ||||
-rw-r--r-- | test/Frontend/warning-options.cpp | 5 |
4 files changed, 53 insertions, 0 deletions
diff --git a/test/Frontend/ast-main.cpp b/test/Frontend/ast-main.cpp new file mode 100644 index 0000000..4bddbe1 --- /dev/null +++ b/test/Frontend/ast-main.cpp @@ -0,0 +1,22 @@ +// RUN: %clang -emit-llvm -S -o %t1.ll -x c++ - < %s +// RUN: %clang -fno-delayed-template-parsing -emit-ast -o %t.ast %s +// RUN: %clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast +// RUN: diff %t1.ll %t2.ll + +// http://llvm.org/bugs/show_bug.cgi?id=15377 +template<typename T> +struct S { + T *mf(); +}; +template<typename T> +T *S<T>::mf() { + // warning: control reaches end of non-void function [-Wreturn-type] +} + +void f() { + S<int>().mf(); +} + +int main() { + return 0; +} diff --git a/test/Frontend/dependency-gen-escaping.c b/test/Frontend/dependency-gen-escaping.c new file mode 100644 index 0000000..84eb242 --- /dev/null +++ b/test/Frontend/dependency-gen-escaping.c @@ -0,0 +1,17 @@ +// REQUIRES: shell +// PR15642 +// RUN: rm -rf %t.dir +// RUN: mkdir -p %t.dir +// RUN: echo > '%t.dir/ .h' +// RUN: echo > '%t.dir/$$.h' +// RUN: echo > '%t.dir/##.h' +// RUN: cd %t.dir +// RUN: %clang -MD -MF - %s -fsyntax-only -I. | FileCheck -strict-whitespace %s + +// CHECK: \ \ \ \ .h +// CHECK: $$$$.h +// CHECK: \#\#.h + +#include " .h" +#include "$$.h" +#include "##.h" diff --git a/test/Frontend/hexagon-target-basic.c b/test/Frontend/hexagon-target-basic.c new file mode 100644 index 0000000..5f95fa2 --- /dev/null +++ b/test/Frontend/hexagon-target-basic.c @@ -0,0 +1,9 @@ +// RUN: %clang_cc1 -emit-llvm -triple hexagon-unknown-unknown %s -S -o /dev/null +// REQUIRES: hexagon-registered-target + +// Testcase for bug 14744. Empty file is sufficient, since the problem +// was a bad data layout string in the Hexagon target causing an ICE +// when compiling any Hexagon program. + +int x; // In C99, a translation unit needs to have at least one declaration. + diff --git a/test/Frontend/warning-options.cpp b/test/Frontend/warning-options.cpp new file mode 100644 index 0000000..85bea62 --- /dev/null +++ b/test/Frontend/warning-options.cpp @@ -0,0 +1,5 @@ +// RUN: %clang_cc1 -Wmonkey -Wno-monkey -Wno-unused-command-line-arguments \ +// RUN: -Wno-unused-command-line-argument %s 2>&1 | FileCheck %s +// CHECK: unknown warning option '-Wmonkey' +// CHECK: unknown warning option '-Wno-monkey' +// CHECK: unknown warning option '-Wno-unused-command-line-arguments'; did you mean '-Wno-unused-command-line-argument'? |