Unnamed: 0
int64 0
0
| repo_id
stringlengths 5
186
| file_path
stringlengths 15
223
| content
stringlengths 1
32.8M
⌀ |
---|---|---|---|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/dependency-gen.c
|
// Basic test
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir/a/b
// RUN: echo > %t.dir/a/b/x.h
// RUN: cd %t.dir
// RUN: %clang -MD -MF - %s -fsyntax-only -I a/b | FileCheck -check-prefix=CHECK-ONE %s
// CHECK-ONE: {{ }}a/b{{[/\\]}}x.h
// PR8974 (-include flag)
// RUN: %clang -MD -MF - %s -fsyntax-only -include a/b/x.h -DINCLUDE_FLAG_TEST | FileCheck -check-prefix=CHECK-TWO %s
// CHECK-TWO: {{ }}a/b/x.h
// rdar://problem/9734352 (paths involving ".")
// RUN: %clang -MD -MF - %s -fsyntax-only -I ./a/b | FileCheck -check-prefix=CHECK-THREE %s
// CHECK-THREE: {{ }}a/b{{[/\\]}}x.h
// RUN: %clang -MD -MF - %s -fsyntax-only -I .//./a/b/ | FileCheck -check-prefix=CHECK-FOUR %s
// CHECK-FOUR: {{ }}a/b{{[/\\]}}x.h
// RUN: %clang -MD -MF - %s -fsyntax-only -I a/b/. | FileCheck -check-prefix=CHECK-FIVE %s
// CHECK-FIVE: {{ }}a/b/.{{[/\\]}}x.h
// RUN: cd a/b
// RUN: %clang -MD -MF - %s -fsyntax-only -I ./ | FileCheck -check-prefix=CHECK-SIX %s
// CHECK-SIX: {{ }}x.h
#ifndef INCLUDE_FLAG_TEST
#include <x.h>
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/stdin.c
|
// RUN: %clang_cc1 -E - < /dev/null > %t
// RUN: grep '<built-in>' %t
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/profile-sample-use-loc-tracking.c
|
// This file tests that -fprofile-sample-use enables location tracking
// generation in the same way that -Rpass does. The sample profiler needs
// to associate line locations in the profile to the code, so it needs the
// frontend to emit source location annotations.
// RUN: %clang_cc1 %s -fprofile-sample-use=%S/Inputs/profile-sample-use-loc-tracking.prof -emit-llvm -o - 2>/dev/null | FileCheck %s
// -fprofile-sample-use should produce source location annotations, exclusively
// (just like -gmlt).
// CHECK: , !dbg !
// CHECK-NOT: DW_TAG_base_type
// But llvm.dbg.cu should be missing (to prevent writing debug info to
// the final output).
// CHECK-NOT: !llvm.dbg.cu = !{
int bar(int j) {
return (j + j - 2) * (j - 2) * j;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/windows-nul.c
|
// RUN: %clang_cc1 nul
// REQUIRES: system-windows
// Verify that cc1 doesn't crash with an assertion failure
// in MemoryBuffer.cpp due to an invalid file size reported
// when the Windows 'nul' device is passed in input.
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/print-header-includes.c
|
// RUN: cd %S
// RUN: %clang_cc1 -include Inputs/test3.h -E -H -o %t.out %s 2> %t.stderr
// RUN: FileCheck < %t.stderr %s
// CHECK-NOT: test3.h
// CHECK: . {{.*test.h}}
// CHECK: .. {{.*test2.h}}
// RUN: %clang_cc1 -include Inputs/test3.h -E --show-includes -o %t.out %s > %t.stdout
// RUN: FileCheck --check-prefix=MS < %t.stdout %s
// MS-NOT: test3.h
// MS: Note: including file: {{.*test.h}}
// MS: Note: including file: {{.*test2.h}}
// MS-NOT: Note
#include "Inputs/test.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-messages.c
|
// RUN: %clang_cc1 -E -frewrite-includes %s -I%S/Inputs/ | %clang_cc1 -Wall -fsyntax-only -Wunused-macros -x c - 2>&1 > %t.1
// RUN: %clang_cc1 -I%S/Inputs/ -Wall -Wunused-macros -fsyntax-only %s 2>&1 > %t.2
// RUN: diff %t.1 %t.2 -u
// expected-no-diagnostics
#include "rewrite-includes-messages.h"
#define UNUSED_MACRO
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/dependency-generation-crash.c
|
// RUN: not %clang_cc1 -E -dependency-file bla -MT %t/doesnotexist/bla.o -MP -o %t/doesnotexist/bla.o -x c /dev/null 2>&1 | FileCheck %s
// CHECK: error: unable to open output file
// rdar://9286457
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/preprocessed-output-macro-first-token.c
|
// This is the first thing other than comments and preprocessor stuff in the
// file.
//
// RUN: %clang_cc1 -fms-extensions -E %s
#pragma comment(lib, "somelib")
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/warning-mapping-2.c
|
// Check that -w has lower priority than -pedantic-errors.
// RUN: %clang_cc1 -verify -pedantic-errors -w %s
void f0() { f1(); } // expected-error {{implicit declaration of function}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/optimization-remark.c
|
// This file tests the -Rpass family of flags (-Rpass, -Rpass-missed
// and -Rpass-analysis) with the inliner. The test is designed to
// always trigger the inliner, so it should be independent of the
// optimization level.
// RUN: %clang_cc1 %s -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline -O0 -emit-llvm-only -verify
// RUN: %clang_cc1 %s -Rpass=inline -Rpass-analysis=inline -Rpass-missed=inline -O0 -emit-llvm-only -gline-tables-only -verify
// RUN: %clang_cc1 %s -Rpass=inline -emit-llvm -o - 2>/dev/null | FileCheck %s
//
// Check that we can override -Rpass= with -Rno-pass.
// RUN: %clang_cc1 %s -Rpass=inline -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
// RUN: %clang_cc1 %s -Rpass=inline -Rno-pass -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
// RUN: %clang_cc1 %s -Rpass=inline -Rno-everything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-NO-REMARKS
// RUN: %clang_cc1 %s -Rpass=inline -Rno-everything -Reverything -emit-llvm -o - 2>&1 | FileCheck %s --check-prefix=CHECK-REMARKS
//
// FIXME: -Reverything should imply -Rpass=.*.
// RUN: %clang_cc1 %s -Reverything -emit-llvm -o - 2>/dev/null | FileCheck %s --check-prefix=CHECK-NO-REMARKS
//
// FIXME: -Rpass should either imply -Rpass=.* or should be rejected.
// RUN: %clang_cc1 %s -Rpass -emit-llvm -o - 2>/dev/null | FileCheck %s --check-prefix=CHECK-NO-REMARKS
// CHECK-REMARKS: remark:
// CHECK-NO-REMARKS-NOT: remark:
// -Rpass should produce source location annotations, exclusively (just
// like -gmlt).
// CHECK: , !dbg !
// CHECK-NOT: DW_TAG_base_type
// But llvm.dbg.cu should be missing (to prevent writing debug info to
// the final output).
// CHECK-NOT: !llvm.dbg.cu = !{
int foo(int x, int y) __attribute__((always_inline));
int foo(int x, int y) { return x + y; }
float foz(int x, int y) __attribute__((noinline));
float foz(int x, int y) { return x * y; }
// The negative diagnostics are emitted twice because the inliner runs
// twice.
//
int bar(int j) {
// expected-remark@+6 {{foz should never be inlined (cost=never)}}
// expected-remark@+5 {{foz will not be inlined into bar}}
// expected-remark@+4 {{foz should never be inlined}}
// expected-remark@+3 {{foz will not be inlined into bar}}
// expected-remark@+2 {{foo should always be inlined}}
// expected-remark@+1 {{foo inlined into bar}}
return foo(j, j - 2) * foz(j - 2, j);
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/unknown-pragmas.c
|
// RUN: %clang_cc1 -Eonly -Wall -verify %s
// RUN: %clang_cc1 -E -dM -Wall -verify %s
// expected-no-diagnostics
#pragma adgohweopihweotnwet
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/undef.c
|
// RUN: %clang -undef -x assembler-with-cpp -E %s
#ifndef __ASSEMBLER__
#error "Must be preprocessed as assembler."
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify-unknown-arg.c
|
// RUN: not %clang_cc1 -asdf -verify %s 2>&1 | FileCheck %s
// expected-no-diagnostics
// CHECK: error: 'error' diagnostics seen but not expected:
// CHECK-NEXT: (frontend): unknown argument: '-asdf'
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/backend-diagnostic.c
|
// REQUIRES: x86-registered-target
// Play around with backend reporting:
// _REGULAR_: Regular behavior, no warning switch enabled.
// _PROMOTE_: Promote warning to error.
// _IGNORE_: Drop backend warning.
//
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin 2> %t.err
// RUN: FileCheck < %t.err %s --check-prefix=REGULAR --check-prefix=ASM
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Werror=frame-larger-than= 2> %t.err
// RUN: FileCheck < %t.err %s --check-prefix=PROMOTE --check-prefix=ASM
// RUN: not %clang_cc1 %s -mllvm -warn-stack-size=0 -no-integrated-as -S -o - -triple=i386-apple-darwin -Wno-frame-larger-than= 2> %t.err
// RUN: FileCheck < %t.err %s --check-prefix=IGNORE --check-prefix=ASM
//
// RUN: %clang_cc1 %s -S -o - -triple=i386-apple-darwin -verify -no-integrated-as
extern void doIt(char *);
// REGULAR: warning: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
// PROMOTE: error: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
// IGNORE-NOT: stack frame size of {{[0-9]+}} bytes in function 'stackSizeWarning'
void stackSizeWarning() {
char buffer[80];
doIt(buffer);
}
// ASM: inline assembly requires more registers than available
void inlineAsmError(int x0, int x1, int x2, int x3, int x4,
int x5, int x6, int x7, int x8, int x9) {
__asm__("hello world": : "r" (x0),"r" (x1),"r" (x2),"r" (x3), // expected-error + {{inline assembly requires more registers than available}}
"r" (x4),"r" (x5),"r" (x6),"r" (x7),"r" (x8),"r" (x9));
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Weverything.c
|
// Regression check that -pedantic-errors doesn't cause other diagnostics to
// become errors.
//
// RUN: %clang_cc1 -verify -Weverything -pedantic-errors %s
int f0(int, unsigned);
int f0(int x, unsigned y) {
return x < y; // expected-warning {{comparison of integers}}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-line-markers.c
|
// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s | FileCheck %s --check-prefix=GNU
// RUN: %clang_cc1 -E -frewrite-includes -fuse-line-directives -I %S/Inputs %s | FileCheck %s --check-prefix=LINE
#include "test.h"
int f() { return x; }
// GNU: {{^}}# 1 "{{.*}}rewrite-includes-line-markers.c"
// GNU: {{^}}#include "test.h"
// GNU: {{^}}# 1 "{{.*}}test.h"
// GNU: {{^}}#include "test2.h"
// GNU: {{^}}# 1 "{{.*}}test2.h"
// GNU: {{^}}int x;
// GNU: {{^}}# 4 "{{.*}}rewrite-includes-line-markers.c" 2
// GNU: {{^}}int f() { return x; }
// LINE: {{^}}#line 1 "{{.*}}rewrite-includes-line-markers.c"
// LINE: {{^}}#include "test.h"
// LINE: {{^}}#line 1 "{{.*}}test.h"
// LINE: {{^}}#include "test2.h"
// LINE: {{^}}#line 1 "{{.*}}test2.h"
// LINE: {{^}}int x;
// LINE: {{^}}#line 4 "{{.*}}rewrite-includes-line-markers.c"
// LINE: {{^}}int f() { return x; }
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/warning-mapping-4.c
|
// RUN: %clang_cc1 -verify -Wno-error=sign-compare %s
// RUN: %clang_cc1 -verify -Wsign-compare -w -Wno-error=sign-compare %s
// expected-no-diagnostics
int f0(int x, unsigned y) {
return x < y;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-modules.c
|
// RUN: rm -rf %t
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -x objective-c %s -F %S/../Modules/Inputs -E -frewrite-includes -o - | FileCheck %s
int bar();
#include <Module/Module.h>
int foo();
#include <Module/Module.h>
// CHECK: int bar();{{$}}
// CHECK-NEXT: #if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: #include <Module/Module.h>{{$}}
// CHECK-NEXT: #endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: # 5 "{{.*[/\\]}}rewrite-includes-modules.c"{{$}}
// CHECK-NEXT: @import Module; /* clang -frewrite-includes: implicit import */{{$}}
// CHECK-NEXT: # 6 "{{.*[/\\]}}rewrite-includes-modules.c"{{$}}
// CHECK-NEXT: int foo();{{$}}
// CHECK-NEXT: #if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: #include <Module/Module.h>{{$}}
// CHECK-NEXT: #endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: # 7 "{{.*[/\\]}}rewrite-includes-modules.c"{{$}}
// CHECK-NEXT: @import Module; /* clang -frewrite-includes: implicit import */{{$}}
// CHECK-NEXT: # 8 "{{.*[/\\]}}rewrite-includes-modules.c"{{$}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/ast-main.cpp
|
// 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;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-macros.c
|
// RUN: %clang_cc1 %s -verify -rewrite-macros -o %t
// RUN: FileCheck %s < %t
// Any CHECK line comments are included in the output, so we use some extra
// regex brackets to make sure we don't match the CHECK lines themselves.
#define A(a,b) a ## b
// CHECK: {{^}} 12 /*A*/ /*(1,2)*/{{$}}
A(1,2)
// CHECK: {{^}} /*_Pragma("mark")*/{{$}}
_Pragma("mark")
// CHECK: /*#warning eek*/{{$}}
/* expected-warning {{eek}} */ #warning eek
// CHECK: {{^}}//#pragma mark mark{{$}}
#pragma mark mark
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify3.c
|
// This test-case runs several sub-tests on -verify to ensure that correct
// diagnostics are generated in relation to the mis-use and non-use of the
// 'expected-no-diagnostics' directive.
// RUN: not %clang_cc1 -DTEST1 -verify %s 2>&1 | FileCheck -check-prefix=CHECK1 %s
#ifdef TEST1
// expected-no-diagnostics
// expected-note {{}}
// CHECK1: error: 'error' diagnostics seen but not expected:
// CHECK1-NEXT: Line 8: expected directive cannot follow 'expected-no-diagnostics' directive
// CHECK1-NEXT: 1 error generated.
#endif
// RUN: not %clang_cc1 -DTEST2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
#ifdef TEST2
#warning X
// expected-warning@-1 {{X}}
// expected-no-diagnostics
// CHECK2: error: 'error' diagnostics seen but not expected:
// CHECK2-NEXT: Line 19: 'expected-no-diagnostics' directive cannot follow other expected directives
// CHECK2-NEXT: 1 error generated.
#endif
// RUN: not %clang_cc1 -DTEST3 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
// RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
#ifdef TEST3
// no directives
// CHECK3: error: no expected directives found: consider use of 'expected-no-diagnostics'
// CHECK3-NEXT: 1 error generated.
#endif
// RUN: %clang_cc1 -E -DTEST4 -verify %s 2>&1 | FileCheck -check-prefix=CHECK4 %s
#ifdef TEST4
#warning X
// expected-warning@-1 {{X}}
// CHECK4-NOT: error: no expected directives found: consider use of 'expected-no-diagnostics'
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/darwin-eabi.c
|
// RUN: %clang -arch armv6m -dM -E %s | FileCheck %s
// RUN: %clang -arch armv7m -dM -E %s | FileCheck %s
// RUN: %clang -arch armv7em -dM -E %s | FileCheck %s
// RUN: %clang_cc1 -triple thumbv7m-apple-unknown-macho -dM -E %s | FileCheck %s
// CHECK-NOT: __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__
// CHECK-NOT: __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/system-header-prefix.c
|
// RUN: %clang --system-header-prefix=libs/ --no-system-header-prefix=libs/mylib/ -I%S/Inputs/SystemHeaderPrefix -Wundef -E %s 2>&1 | FileCheck %s
// RUN: %clang --system-header-prefix libs/ --no-system-header-prefix libs/mylib/ -I%S/Inputs/SystemHeaderPrefix -Wundef -E %s 2>&1 | FileCheck %s
#include "src/all.h"
// CHECK-NOT: BOOST
// CHECK: libs{{/|\\}}mylib{{/|\\}}warn.h:1:5: warning: 'MYLIB' is not defined, evaluates to 0
// CHECK-NOT: BOOST
// CHECK: libs{{/|\\}}mylib{{/|\\}}warn.h:1:5: warning: 'MYLIB' is not defined, evaluates to 0
// CHECK-NOT: BOOST
// CHECK: src{{/|\\}}warn.h:1:5: warning: 'SRC' is not defined, evaluates to 0
// CHECK-NOT: BOOST
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/mips-long-double.c
|
// RUN: %clang_cc1 -triple mips64-unknown-freebsd -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips-unknown-freebsd -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips-unknown-linux -std=c11 -verify %s
// RUN: %clang_cc1 -triple mips64-unknown-linux -std=c11 -verify %s
// expected-no-diagnostics
#ifdef _ABI64
# ifdef __FreeBSD__
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
# else
_Static_assert(sizeof(long double) == 16, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 16, "alignof long double is wrong");
# endif
#else
_Static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
_Static_assert(_Alignof(long double) == 8, "alignof long double is wrong");
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/mfpmath.c
|
// RUN: %clang_cc1 -triple i686-pc-linux -target-feature -sse %s
// RUN: %clang_cc1 -triple i686-pc-linux -target-feature -sse -mfpmath 387 %s
// RUN: %clang_cc1 -triple i686-pc-linux -target-feature +sse %s
// RUN: %clang_cc1 -triple i686-pc-linux -target-feature +sse -mfpmath sse %s
// RUN: not %clang_cc1 -triple i686-pc-linux -target-feature +sse \
// RUN: -mfpmath xyz %s 2>&1 | FileCheck --check-prefix=CHECK-XYZ %s
// CHECK-XYZ: error: unknown FP unit 'xyz'
// RUN: not %clang_cc1 -triple i686-pc-linux -target-feature +sse \
// RUN: -mfpmath 387 %s 2>&1 | FileCheck --check-prefix=CHECK-NO-387 %s
// CHECK-NO-387: error: the '387' unit is not supported with this instruction set
// RUN: not %clang_cc1 -triple i686-pc-linux -target-feature -sse \
// RUN: -mfpmath sse %s 2>&1 | FileCheck --check-prefix=CHECK-NO-SSE %s
// CHECK-NO-SSE: error: the 'sse' unit is not supported with this instruction set
// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp %s
// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp2 %s
// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp3 %s
// RUN: %clang_cc1 -triple arm-apple-darwin10 -mfpmath vfp4 %s
// RUN: %clang_cc1 -triple arm-apple-darwin10 -target-cpu cortex-a9 \
// RUN: -mfpmath neon %s
// RUN: not %clang_cc1 -triple arm-apple-darwin10 -mfpmath foo %s 2>&1 \
// RUN: FileCheck --check-prefix=CHECK-FOO %s
// CHECK-FOO: unknown FP unit 'foo'
// RUN: not %clang_cc1 -triple arm-apple-darwin10 -target-cpu arm1136j-s \
// RUN: -mfpmath neon %s 2>&1 | FileCheck --check-prefix=CHECK-NO-NEON %s
// RUN: not %clang_cc1 -triple arm-apple-darwin10 -target-cpu cortex-a9 \
// RUN: -target-feature -neon -mfpmath neon %s 2>&1 | FileCheck --check-prefix=CHECK-NO-NEON %s
// CHECK-NO-NEON: error: the 'neon' unit is not supported with this instruction set
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/disable-output.c
|
// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -emit-llvm-only -triple=i386-apple-darwin -o %t
// RUN: not rm %t
// RUN: %clang_cc1 %s -emit-codegen-only -triple=i386-apple-darwin -o %t
// RUN: not rm %t
// Test that output is not generated when emission is disabled.
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/output-failures.c
|
// RUN: not %clang_cc1 -emit-llvm -o %S/doesnotexist/somename %s 2> %t
// RUN: FileCheck -check-prefix=OUTPUTFAIL -input-file=%t %s
// OUTPUTFAIL: error: unable to open output file '{{.*}}{{[/\\]}}test{{[/\\]}}Frontend{{[/\\]}}doesnotexist{{[/\\]}}somename': '{{[nN]}}o such file or directory'
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/iframework.c
|
// RUN: %clang -fsyntax-only -iframework %S/Inputs %s -Xclang -verify
// expected-no-diagnostics
#include <TestFramework/TestFramework.h>
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/exceptions.c
|
// RUN: %clang_cc1 -fms-compatibility -fexceptions -fcxx-exceptions -DMS_MODE -verify %s
// expected-no-diagnostics
// RUN: %clang_cc1 -fms-compatibility -fexceptions -verify %s
// expected-no-diagnostics
#if defined(MS_MODE) && defined(__EXCEPTIONS)
#error __EXCEPTIONS should not be defined.
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/source-col-map.c
|
// RUN: not %clang_cc1 -fsyntax-only -fmessage-length 75 -o /dev/null -x c < %s 2>&1 | FileCheck %s -strict-whitespace
// Test case for the text diagnostics source column conversion crash.
// This test case tries to check the error diagnostic message printer, which is
// responsible to create the code snippet shorter than the message-length (in
// number of columns.)
//
// The error diagnostic message printer should be able to handle the non-ascii
// characters without any segmentation fault or assertion failure. If your
// changes to clang frontend crashes this case, it is likely that you are mixing
// column index with byte index which are two totally different concepts.
// NOTE: This file is encoded in UTF-8 and intentionally contains some
// non-ASCII characters.
__attribute__((format(printf, 1, 2)))
extern int printf(const char *fmt, ...);
void test1(Unknown* b); // αααα αααα αααα αααα αααα αααα αααα αααα αααα αααα αααα
// CHECK: unknown type name 'Unknown'
// CHECK-NEXT: void test1(Unknown* b); // αααα αααα αααα αααα αααα αααα αααα ααα...
// CHECK-NEXT: {{^ \^$}}
void test2(Unknown* b); // αααα αααα αααα αααα αααα αααα αααα αααα αααα
// CHECK: unknown type name 'Unknown'
// CHECK-NEXT: void test2(Unknown* b); // αααα αααα αααα αααα αααα αααα αααα αααα αααα
// CHECK-NEXT: {{^ \^$}}
void test3() {
/* αααα αααα αααα αααα αααα αααα αααα αααα αααα αααα */ printf("%d", "s");
}
// CHECK: format specifies type 'int' but the argument has
// CHECK: type 'char *'
// CHECK-NEXT: ...αααα αααα αααα αααα αααα αααα αααα αααα αααα */ printf("%d", "s");
// CHECK-NEXT: {{^ ~~ \^~~$}}
// CHECK-NEXT: {{^ %s$}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify-ignore-unexpected.c
|
// RUN: not %clang_cc1 -DTEST_SWITCH -verify-ignore-unexpected=remark,aoeu,note -verify %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-BAD-SWITCH %s
#ifdef TEST_SWITCH
// expected-no-diagnostics
#endif
// CHECK-BAD-SWITCH: error: 'error' diagnostics seen but not expected:
// CHECK-BAD-SWITCH-NEXT: (frontend): invalid value 'aoeu' in '-verify-ignore-unexpected='
// RUN: %clang_cc1 -DTEST1 -verify %s
// RUN: %clang_cc1 -DTEST1 -verify -verify-ignore-unexpected %s
#ifdef TEST1
#warning MyWarning1
// expected-warning@-1 {{MyWarning1}}
int x; // expected-note {{previous definition is here}}
float x; // expected-error {{redefinition of 'x'}}
#endif
// RUN: not %clang_cc1 -DTEST2 -verify %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-UNEXP %s
// RUN: not %clang_cc1 -DTEST2 -verify -verify-ignore-unexpected= %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-UNEXP %s
// RUN: not %clang_cc1 -DTEST2 -verify -verify-ignore-unexpected=note %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-NOTE %s
// RUN: not %clang_cc1 -DTEST2 -verify -verify-ignore-unexpected=warning %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-WARN %s
// RUN: not %clang_cc1 -DTEST2 -verify -verify-ignore-unexpected=error %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-ERR %s
#ifdef TEST2
#warning MyWarning2
int x;
float x;
#endif
// CHECK-UNEXP: no expected directives found
// CHECK-UNEXP-NEXT: 'error' diagnostics seen but not expected
// CHECK-UNEXP-NEXT: Line {{[0-9]+}}: redefinition of 'x'
// CHECK-UNEXP-NEXT: 'warning' diagnostics seen but not expected
// CHECK-UNEXP-NEXT: Line {{[0-9]+}}: MyWarning2
// CHECK-UNEXP-NEXT: 'note' diagnostics seen but not expected
// CHECK-UNEXP-NEXT: Line {{[0-9]+}}: previous definition is here
// CHECK-UNEXP-NEXT: 4 errors generated.
// CHECK-NOTE: no expected directives found
// CHECK-NOTE-NEXT: 'error' diagnostics seen but not expected
// CHECK-NOTE-NEXT: Line {{[0-9]+}}: redefinition of 'x'
// CHECK-NOTE-NEXT: 'warning' diagnostics seen but not expected
// CHECK-NOTE-NEXT: Line {{[0-9]+}}: MyWarning2
// CHECK-NOTE-NEXT: 3 errors generated.
// CHECK-WARN: no expected directives found
// CHECK-WARN-NEXT: 'error' diagnostics seen but not expected
// CHECK-WARN-NEXT: Line {{[0-9]+}}: redefinition of 'x'
// CHECK-WARN-NEXT: 'note' diagnostics seen but not expected
// CHECK-WARN-NEXT: Line {{[0-9]+}}: previous definition is here
// CHECK-WARN-NEXT: 3 errors generated.
// CHECK-ERR: no expected directives found
// CHECK-ERR-NEXT: 'warning' diagnostics seen but not expected
// CHECK-ERR-NEXT: Line {{[0-9]+}}: MyWarning2
// CHECK-ERR-NEXT: 'note' diagnostics seen but not expected
// CHECK-ERR-NEXT: Line {{[0-9]+}}: previous definition is here
// CHECK-ERR-NEXT: 3 errors generated.
// RUN: not %clang_cc1 -DTEST3 -verify -verify-ignore-unexpected %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-EXP %s
#ifdef TEST3
// expected-error {{test3}}
#endif
// CHECK-EXP: 'error' diagnostics expected but not seen
// CHECK-EXP-NEXT: Line {{[0-9]+}}: test3
// RUN: not %clang_cc1 -DTEST4 -verify -verify-ignore-unexpected %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-NOEXP %s
// RUN: not %clang_cc1 -DTEST4 -verify -verify-ignore-unexpected=warning,error,note %s 2>&1 \
// RUN: | FileCheck -check-prefix=CHECK-NOEXP %s
#ifdef TEST4
#warning MyWarning4
int x;
float x;
#endif
// CHECK-NOEXP: error: no expected directives found
// CHECK-NOEXP-NEXT: 1 error generated
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/trigraphs.cpp
|
// RUN: %clang_cc1 -DSTDCPP11 -std=c++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDGNU11 -std=gnu++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDGNU11TRI -ftrigraphs -std=gnu++11 -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDCPP17 -std=c++1z -verify -fsyntax-only %s
// RUN: %clang_cc1 -DSTDCPP17TRI -ftrigraphs -std=c++1z -verify -fsyntax-only %s
// RUN: %clang_cc1 -DMSCOMPAT -fms-compatibility -std=c++11 -verify -fsyntax-only %s
void foo() {
#if defined(NOFLAGS) || defined(STDCPP11) || defined(STDGNU11TRI) || \
defined(STDCPP17TRI)
const char c[] = "??/n"; // expected-warning{{trigraph converted to '\' character}}
#elif defined(STDGNU11) || defined(STDCPP17) || defined(MSCOMPAT)
const char c[] = "??/n"; // expected-warning{{trigraph ignored}}
#else
#error Not handled.
#endif
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes.c
|
// RUN: not %clang_cc1 -verify -E -frewrite-includes -DFIRST -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
// RUN: not %clang_cc1 -verify -E -frewrite-includes -P -DFIRST -I %S/Inputs %s -o - | FileCheck -check-prefix=CHECKNL -strict-whitespace %s
// STARTCOMPARE
#define A(a,b) a ## b
A(1,2)
#include "rewrite-includes1.h"
#ifdef FIRST
#define HEADER "rewrite-includes3.h"
#include HEADER
#else
#include "rewrite-includes4.h"
#endif
// indented
#/**/include /**/ "rewrite-includes5.h" /**/ \
#include "rewrite-includes6.h" // comment
#include "rewrite-includes6.h" /* comment
continues */
#include "rewrite-includes7.h"
#include "rewrite-includes7.h"
#include "rewrite-includes8.h"
// ENDCOMPARE
// CHECK: {{^}}# 1 "{{.*}}rewrite-includes.c"{{$}}
// CHECK: {{^}}// STARTCOMPARE{{$}}
// CHECK-NEXT: {{^}}#define A(a,b) a ## b{{$}}
// CHECK-NEXT: {{^}}A(1,2){{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes1.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 6 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 1{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#pragma clang system_header{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 3{{$}}
// CHECK-NEXT: {{^}}included_line1{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes2.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 3 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 3{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes2.h" 1 3{{$}}
// CHECK-NEXT: {{^}}included_line2{{$}}
// CHECK-NEXT: {{^}}# 4 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes1.h" 2 3{{$}}
// CHECK-NEXT: {{^}}# 7 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#ifdef FIRST{{$}}
// CHECK-NEXT: {{^}}#define HEADER "rewrite-includes3.h"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include HEADER{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 9 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes3.h" 1{{$}}
// CHECK-NEXT: {{^}}included_line3{{$}}
// CHECK-NEXT: {{^}}# 10 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#else{{$}}
// CHECK-NEXT: {{^}}# 11 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes4.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 11 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 12 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
// CHECK-NEXT: {{^}}# 13 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}} // indented{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#/**/include /**/ "rewrite-includes5.h" /**/ {{\\}}{{$}}
// CHECK-NEXT: {{^}} {{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 15 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes5.h" 1{{$}}
// CHECK-NEXT: {{^}}included_line5{{$}}
// CHECK-NEXT: {{^}}# 16 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes6.h" // comment{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 16 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes6.h" 1{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#pragma once{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 2 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes6.h"{{$}}
// CHECK-NEXT: {{^}}included_line6{{$}}
// CHECK-NEXT: {{^}}# 17 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}} {{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes6.h" /* comment{{$}}
// CHECK-NEXT: {{^}} continues */{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 19 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 20 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes7.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 20 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes7.h" 1{{$}}
// CHECK-NEXT: {{^}}#ifndef REWRITE_INCLUDES_7{{$}}
// CHECK-NEXT: {{^}}#define REWRITE_INCLUDES_7{{$}}
// CHECK-NEXT: {{^}}included_line7{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
// CHECK-NEXT: {{^}}# 5 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes7.h"{{$}}
// CHECK-NEXT: {{^}}# 21 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes7.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 21 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 22 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 22 "{{.*}}rewrite-includes.c"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h" 1{{$}}
// CHECK-NEXT: {{^}}#if (1)/*__has_include_next(<rewrite-includes8.h>)*/{{$}}
// CHECK-NEXT: {{^}}#elif (0)/*__has_include(<rewrite-includes8.hfail>)*/{{$}}
// CHECK-NEXT: {{^}}# 3 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
// CHECK-NEXT: {{^}}# 4 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}#if !(1)/*__has_include("rewrite-includes8.h")*/{{$}}
// CHECK-NEXT: {{^}}#endif{{$}}
// CHECK-NEXT: {{^}}# 6 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes8.h"{{$}}
// CHECK-NEXT: {{^}}# 23 "{{.*}}rewrite-includes.c" 2{{$}}
// CHECK-NEXT: {{^}}// ENDCOMPARE{{$}}
// CHECKNL: {{^}}// STARTCOMPARE{{$}}
// CHECKNL-NEXT: {{^}}#define A(a,b) a ## b{{$}}
// CHECKNL-NEXT: {{^}}A(1,2){{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes1.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#pragma clang system_header{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}included_line1{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes2.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}included_line2{{$}}
// CHECKNL-NEXT: {{^}}#ifdef FIRST{{$}}
// CHECKNL-NEXT: {{^}}#define HEADER "rewrite-includes3.h"{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include HEADER{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}included_line3{{$}}
// CHECKNL-NEXT: {{^}}#else{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes4.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
// CHECKNL-NEXT: {{^}} // indented{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#/**/include /**/ "rewrite-includes5.h" /**/ {{\\}}{{$}}
// CHECKNL-NEXT: {{^}} {{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}included_line5{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes6.h" // comment{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#pragma once{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}included_line6{{$}}
// CHECKNL-NEXT: {{^}} {{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes6.h" /* comment{{$}}
// CHECKNL-NEXT: {{^}} continues */{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes7.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#ifndef REWRITE_INCLUDES_7{{$}}
// CHECKNL-NEXT: {{^}}#define REWRITE_INCLUDES_7{{$}}
// CHECKNL-NEXT: {{^}}included_line7{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes7.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#include "rewrite-includes8.h"{{$}}
// CHECKNL-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECKNL-NEXT: {{^}}#if (1)/*__has_include_next(<rewrite-includes8.h>)*/{{$}}
// CHECKNL-NEXT: {{^}}#elif (0)/*__has_include(<rewrite-includes8.hfail>)*/{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
// CHECKNL-NEXT: {{^}}#if !(1)/*__has_include("rewrite-includes8.h")*/{{$}}
// CHECKNL-NEXT: {{^}}#endif{{$}}
// CHECKNL-NEXT: {{^}}// ENDCOMPARE{{$}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify.c
|
// RUN: %clang_cc1 -DTEST1 -verify %s
// RUN: not %clang_cc1 -DTEST2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
// RUN: not %clang_cc1 -DTEST3 -verify %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
// RUN: not %clang_cc1 -DTEST4 -verify %s 2>&1 | FileCheck -check-prefix=CHECK4 %s
// RUN: not %clang_cc1 -DTEST5 -verify %s 2>&1 | FileCheck -check-prefix=CHECK5 %s
// expected-warning@ malformed
// expected-error@7 1 {{missing or invalid line number}}
// expected-warning@0 malformed
// expected-error@10 {{missing or invalid line number}}
// expected-warning@-50 malformed
// expected-error@13 {{missing or invalid line number}}
// expected-warning malformed
// expected-error@16 {{cannot find start}}
// expected-error 0+ {{should also be ignored}}
#ifdef TEST1
#if 0
// expected-error {{should be ignored}}
#endif
// eexpected-error {{should also be ignored: unrecognised directive}}
#error should not be ignored
// expected-error@-1 1+ {{should not be ignored}}
#line 90
unexpected a; // expected-error@+0 + {{unknown type}}
#line 60
unexpected b; // expected-error@33 1-1 {{unknown type}}
// expected-error@+2 {{file not found}} check that multi-line handled correctly: \
#include "missing_header_file.include"
#endif
#ifdef TEST2
#define MACRO some_value // expected-error {{define_error}}
#undef MACRO extra_token // expected-warning {{undef_error}}
#line -2 // expected-error {{line_error}}
#error AAA // expected-error {{BBB}} <- this shall be part of diagnostic
#warning CCC // expected-warning {{DDD}} <- this shall be part of diagnostic
#if 0
// This is encapsulated in "#if 0" so that the expected-* checks below
// are not inadvertently included in the diagnostic checking!
// CHECK2: error: 'error' diagnostics expected but not seen:
// CHECK2-NEXT: Line 41: define_error
// CHECK2-NEXT: Line 43: line_error
// CHECK2-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK2-NEXT: Line 43: #line directive requires a positive integer argument
// CHECK2-NEXT: Line 44: AAA // expected-error {{[{][{]BBB[}][}]}} <- this shall be part of diagnostic
// CHECK2-NEXT: error: 'warning' diagnostics expected but not seen:
// CHECK2-NEXT: Line 42: undef_error
// CHECK2-NEXT: error: 'warning' diagnostics seen but not expected:
// CHECK2-NEXT: Line 42: extra tokens at end of #undef directive
// CHECK2-NEXT: Line 45: CCC // expected-warning {{[{][{]DDD[}][}]}} <- this shall be part of diagnostic
// CHECK2-NEXT: 7 errors generated.
#endif
#endif
#ifdef TEST3
#ifndef TEST3 // expected-note {{line_67}}
// expected-note {{line_68_ignored}}
# ifdef UNDEFINED // expected-note {{line_69_ignored}}
# endif // expected-note {{line_70_ignored}}
#elif defined(TEST3) // expected-note {{line_71}}
# if 1 // expected-note {{line_72}}
// expected-note {{line_73}}
# else // expected-note {{line_74}}
// expected-note {{line_75_ignored}}
# ifndef TEST3 // expected-note {{line_76_ignored}}
# endif // expected-note {{line_77_ignored}}
# endif // expected-note {{line_78}}
#endif
// CHECK3: error: 'note' diagnostics expected but not seen:
// CHECK3-NEXT: Line 67: line_67
// CHECK3-NEXT: Line 71: line_71
// CHECK3-NEXT: Line 72: line_72
// CHECK3-NEXT: Line 73: line_73
// CHECK3-NEXT: Line 74: line_74
// CHECK3-NEXT: Line 78: line_78
// CHECK3-NEXT: 6 errors generated.
#endif
#ifdef TEST4
#include "missing_header_file.include" // expected-error {{include_error}}
// CHECK4: error: 'error' diagnostics expected but not seen:
// CHECK4-NEXT: Line 92: include_error
// CHECK4-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK4-NEXT: Line 92: 'missing_header_file.include' file not found
// CHECK4-NEXT: 2 errors generated.
#endif
#ifdef TEST5
#include "verify-directive.h"
// expected-error@50 {{source file test}}
// CHECK5: error: 'error' diagnostics expected but not seen:
// CHECK5-NEXT: Line 1 (directive at {{.*}}verify-directive.h:2): include file test
// CHECK5-NEXT: Line 50 (directive at {{.*}}verify.c:103): source file test
// CHECK5-NEXT: 2 errors generated.
#endif
#if 0
// RUN: not %clang_cc1 -verify %t.invalid 2>&1 | FileCheck -check-prefix=CHECK6 %s
// CHECK6: error: no expected directives found: consider use of 'expected-no-diagnostics'
// CHECK6-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK6-NEXT: (frontend): error reading '{{.*}}verify.c.tmp.invalid'
// CHECK6-NEXT: 2 errors generated.
// RUN: printf '//expected-error@2{{1}}\n#error 2\n' | not %clang_cc1 -verify 2>&1 | FileCheck -check-prefix=CHECK7 %s
// CHECK7: error: 'error' diagnostics expected but not seen:
// CHECK7-NEXT: Line 2 (directive at <stdin>:1): 1
// CHECK7-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK7-NEXT: Line 2: 2
// CHECK7-NEXT: 2 errors generated.
#endif
#ifdef TEST8
// RUN: not %clang_cc1 -DTEST8 -verify %s 2>&1 | FileCheck -check-prefix=CHECK8 %s
// expected-warning@nonexistent-file:1 {{ }}
// expected-error@-1 {{file 'nonexistent-file' could not be located}}
// [email protected]: {{ }}
// expected-error@-1 {{missing or invalid line number}}
// [email protected]:0 {{ }}
// expected-error@-1 {{missing or invalid line number}}
// [email protected]:0*{{ }}
// expected-error@-1 {{missing or invalid line number}}
// [email protected]:*0{{ }}
// syntactically ok -- means match in any line for 0 occurrences.
// [email protected]:1 {{diagnostic}}
// CHECK8: error: 'warning' diagnostics expected but not seen:
// CHECK8-NEXT: File {{.*}}verify-directive.h Line 1 (directive at {{.*}}verify.c:146): diagnostic
// CHECK8-NEXT: 1 error generated.
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-invalid-hasinclude.c
|
// RUN: not %clang_cc1 -E -frewrite-includes -DFIRST -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
#if __has_include bar.h
#endif
#if __has_include(bar.h)
#endif
#if __has_include(<bar.h)
#endif
// CHECK: #if __has_include bar.h
// CHECK: #endif
// CHECK: #if __has_include(bar.h)
// CHECK: #endif
// CHECK: #if __has_include(<bar.h)
// CHECK: #endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify2.h
|
#if 0
// expected-error {{should be ignored}}
#endif
#error header
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/ast-codegen.c
|
// REQUIRES: x86-registered-target
// RUN: %clang -target i386-unknown-unknown -emit-ast -o %t.ast %s
// RUN: %clang -target i386-unknown-unknown -emit-llvm -S -o - %t.ast | FileCheck %s
// CHECK: module asm "foo"
__asm__("foo");
// CHECK: @g0 = common global i32 0, align 4
int g0;
// CHECK: define i32 @f0()
int f0() {
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-header-cmd-line.c
|
// RUN: %clang_cc1 -E -frewrite-includes -include rewrite-includes2.h -I %S/Inputs %s -o - | FileCheck -strict-whitespace %s
// STARTMAIN
// CHECK-NOT: {{^}}#define
// CHECK: included_line2
// CHECK: {{^}}// STARTMAIN{{$}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/macros.c
|
// RUN: %clang_cc1 -DA= -DB=1 -verify -fsyntax-only %s
// expected-no-diagnostics
int a[(B A) == 1 ? 1 : -1];
// PR13747 - Don't warn about unused results with statement exprs in macros.
void stuff(int,int,int);
#define memset(x,y,z) ({ stuff(x,y,z); x; })
void foo(int a, int b, int c) {
memset(a,b,c); // No warning!
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/optimization-remark-line-directive.c
|
// This file tests -Rpass diagnostics together with #line
// directives. We cannot map #line directives back to
// a SourceLocation.
// RUN: %clang_cc1 %s -Rpass=inline -gline-tables-only -dwarf-column-info -emit-llvm-only -verify
int foo(int x, int y) __attribute__((always_inline));
int foo(int x, int y) { return x + y; }
// expected-remark@+2 {{foo inlined into bar}} expected-note@+2 {{could not determine the original source location for /bad/path/to/original.c:1230:25}}
#line 1230 "/bad/path/to/original.c"
int bar(int j) { return foo(j, j - 2); }
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/warning-mapping-1.c
|
// Check that -w has higher priority than -Werror.
// RUN: %clang_cc1 -verify -Wsign-compare -Werror -w %s
// expected-no-diagnostics
int f0(int x, unsigned y) {
return x < y;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/x86_64-nacl-types.cpp
|
// RUN: %clang_cc1 -triple x86_64-unknown-nacl -std=c++11 -verify %s
// expected-no-diagnostics
#include <stddef.h>
#include <stdarg.h>
static_assert(alignof(char) == 1, "alignof char is wrong");
static_assert(sizeof(short) == 2, "sizeof short is wrong");
static_assert(alignof(short) == 2, "alignof short is wrong");
static_assert(sizeof(int) == 4, "sizeof int is wrong");
static_assert(alignof(int) == 4, "alignof int is wrong");
static_assert(sizeof(long) == 4, "sizeof long is wrong");
static_assert(alignof(long) == 4, "alignof long is wrong");
static_assert(sizeof(long long) == 8, "sizeof long long is wrong wrong");
static_assert(alignof(long long) == 8, "alignof long long is wrong wrong");
static_assert(sizeof(void*) == 4, "sizeof void * is wrong");
static_assert(alignof(void*) == 4, "alignof void * is wrong");
static_assert(sizeof(float) == 4, "sizeof float is wrong");
static_assert(alignof(float) == 4, "alignof float is wrong");
static_assert(sizeof(double) == 8, "sizeof double is wrong");
static_assert(alignof(double) == 8, "alignof double is wrong");
static_assert(sizeof(long double) == 8, "sizeof long double is wrong");
static_assert(alignof(long double) == 8, "alignof long double is wrong");
static_assert(sizeof(va_list) == 16, "sizeof va_list is wrong");
static_assert(alignof(va_list) == 4, "alignof va_list is wrong");
static_assert(sizeof(size_t) == 4, "sizeof size_t is wrong");
static_assert(alignof(size_t) == 4, "alignof size_t is wrong");
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/hexagon-target-basic.c
|
// 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.
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/warning-mapping-5.c
|
// Check that #pragma diagnostic warning overrides -Werror. This matches GCC's
// original documentation, but not its earlier implementations.
//
// RUN: %clang_cc1 -verify -Werror %s
#pragma clang diagnostic warning "-Wsign-compare"
int f0(int x, unsigned y) {
return x < y; // expected-warning {{comparison of integers}}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/cc1-return-codes.c
|
// cc1 immediate arguments (arguments which displays information and exits)
// shall exit indicating success (return code 0)
// RUN: %clang -cc1 -help
// RUN: %clang -cc1 -version
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/stdlang.c
|
// RUN: %clang_cc1 -x cuda -std=c++11 -DCUDA %s
// RUN: %clang_cc1 -x cl -std=c99 -DOPENCL %s
// expected-no-diagnostics
#if defined(CUDA)
__attribute__((device)) void f_device();
#elif defined(OPENCL)
kernel void func(void);
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify-fatal.c
|
// RUN: not %clang_cc1 -Wfatal-errors -verify %s 2>&1 | FileCheck %s
#error first fatal
// expected-error@-1 {{first fatal}}
#error second fatal
// expected-error@-1 {{second fatal}}
// CHECK: error: 'error' diagnostics expected but not seen:
// CHECK-NEXT: Line 6 (directive at {{.*}}verify-fatal.c:7): second fatal
// CHECK-NEXT: 1 error generated.
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/darwin-version.c
|
// RUN: %clang_cc1 -triple armv6-apple-ios3.0.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '30000' | count 1
// RUN: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple armv6-apple-ios2.0.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20000' | count 1
// RUN: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple armv6-apple-ios2.2.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20200' | count 1
// RUN: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple armv6-apple-ios2.3.1 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t | grep '20301' | count 1
// RUN: not grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple i386-apple-macosx10.4.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1040' | count 1
// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple i386-apple-macosx10.4.10 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1049' | count 1
// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple i386-apple-macosx10.5.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1050' | count 1
// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple i386-apple-macosx10.6.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '1060' | count 1
// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10.0 -dM -E -o %t %s
// RUN: grep '__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' %t | grep '101000' | count 1
// RUN: not grep '__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' %t
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/cpp-output.c
|
// RUN: %clang -E -o %t -C %s
// RUN: grep '^int x; // comment' %t
// RUN: grep '^x x' %t
// RUN: %clang -E -o %t -CC %s
// RUN: grep '^int x; // comment' %t
// RUN: grep '^x /\* comment \*/ x /\* comment \*/' %t
int x; // comment
#define A(foo, bar) foo bar
#define B x // comment
A(B, B)
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify-directive.h
|
// Check that directives inside includes are included!
// expected-error@1 {{include file test}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/dependency-gen-escaping.c
|
// PR15642
// RUN: %clang -M -MG -fno-ms-compatibility %s | FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=SEP2F
// RUN: %clang -M -MG -fms-compatibility %s | FileCheck -strict-whitespace %s --check-prefix=CHECK --check-prefix=SEP5C
// RUN: %clang -M -MG -MV %s | FileCheck -strict-whitespace %s --check-prefix=NMAKE
// CHECK: \ \ \ \ .h
// CHECK: $$$$.h
// CHECK: \#\#.h
// NMAKE: " .h"
// NMAKE: "$$.h"
// NMAKE: "##.h"
// NMAKE-NOT: "
// NMAKE: normal.h
// NMAKE-NOT: "
#include " .h"
#include "$$.h"
#include "##.h"
#include "normal.h"
// Backslash followed by # or space should escape both characters, because
// that's what GNU Make wants. GCC does the right thing with space, but not
// #, so Clang does too. (There should be 3 backslashes before the #.)
// SEP2F: a\b\\#c\\\ d.h
// With -fms-compatibility, Backslashes in #include are treated as path separators.
// Backslashes are given in the emission for special characters, like 0x20 or 0x23.
// SEP5C: a{{[/\\]}}b{{[/\\]}}\#c{{/|\\\\}}\ d.h
// These combinations are just another case for NMAKE.
// NMAKE: "a{{[/\\]}}b{{[/\\]}}#c{{[/\\]}} d.h"
#include "a\b\#c\ d.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-bom.c
|
// RUN: grep -q $'^\xEF\xBB\xBF' %S/Inputs/rewrite-includes-bom.h
// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s -o %t.c
// RUN: ! grep -q $'\xEF\xBB\xBF' %t.c
// RUN: %clang_cc1 -fsyntax-only -verify %t.c
// expected-no-diagnostics
// REQUIRES: shell
#include "rewrite-includes-bom.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/ir-support.c
|
// Test that we can consume LLVM IR/bitcode in the frontend and produce
// equivalent output to a standard compilation.
// We strip differing '.file' directives before comparing.
// Reference output:
// RUN: %clang_cc1 -S -o - %s | grep -v '\.file' > %t.s
// LLVM bitcode:
// RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
// RUN: %clang_cc1 -S -o - %t.bc | grep -v '\.file' > %t.bc.s
// RUN: diff %t.s %t.bc.s
// LLVM IR source code:
// RUN: %clang_cc1 -emit-llvm -o %t.ll %s
// RUN: %clang_cc1 -S -o - %t.ll | grep -v '\.file' > %t.ll.s
// RUN: diff %t.s %t.ll.s
int f() { return 0; }
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Wno-everything.c
|
// RUN: %clang_cc1 -verify -Wno-everything -Wsign-compare %s
int f0(int, unsigned);
int f0(int x, unsigned y) {
if (x=3);
return x < y; // expected-warning {{comparison of integers}}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-cli-include.c
|
// RUN: not %clang_cc1 -verify -E -frewrite-includes -include %S/Inputs/rewrite-includes2.h %s -o - | FileCheck -strict-whitespace %s
main_file_line
// CHECK: {{^}}# 1 "<built-in>"{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*[/\\]Inputs(/|\\\\)}}rewrite-includes2.h" 1{{$}}
// CHECK-NEXT: {{^}}included_line2{{$}}
// CHECK-NEXT: {{^}}# 1 "<built-in>" 2{{$}}
// CHECK-NEXT: {{^}}# 1 "{{.*}}rewrite-includes-cli-include.c"{{$}}
// CHECK-NEXT: FileCheck
// CHECK-NEXT: {{^}}main_file_line{{$}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-eof.c
|
// RUN: %clang_cc1 -E -frewrite-includes -I %S/Inputs %s
// expected-no-diagnostics
// Note: there's no newline at the end of this C file.
#include "rewrite-includes-bom.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/verify2.c
|
#if 0
// RUN: not %clang_cc1 -verify %s 2>&1 | FileCheck %s
// Please note that all comments are inside "#if 0" blocks so that
// VerifyDiagnosticConsumer sees no comments while processing this
// test-case (and hence no expected-* directives).
#endif
#include "verify2.h"
#error source
#if 0
// expected-error {{should be ignored}}
// CHECK: error: no expected directives found: consider use of 'expected-no-diagnostics'
// CHECK-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK-NEXT: Line 5: header
// CHECK-NEXT: Line 10: source
// CHECK-NEXT: 3 errors generated.
#endif
#ifdef CHECK2
// RUN: not %clang_cc1 -DCHECK2 -verify %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
// The following checks that -verify can match "any line" in an included file.
// The location of the diagnostic need therefore only match in the file, not to
// a specific line number. This is useful where -verify is used as a testing
// tool for 3rd-party libraries where headers may change and the specific line
// number of a diagnostic in a header is not important.
// [email protected]:* {{header}}
// [email protected]:* {{unknown}}
// CHECK2: error: 'error' diagnostics expected but not seen:
// CHECK2-NEXT: File {{.*}}verify2.h Line * (directive at {{.*}}verify2.c:32): unknown
// CHECK2-NEXT: error: 'error' diagnostics seen but not expected:
// CHECK2-NEXT: File {{.*}}verify2.c Line 10: source
// CHECK2-NEXT: 2 errors generated.
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-missing.c
|
// RUN: %clang_cc1 -verify -E -frewrite-includes %s -o - | FileCheck -strict-whitespace %s
#include "foobar.h" // expected-error {{'foobar.h' file not found}}
// CHECK: {{^}}#if 0 /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}#include "foobar.h"
// CHECK-NEXT: {{^}}#endif /* expanded by -frewrite-includes */{{$}}
// CHECK-NEXT: {{^}}# 3 "{{.*}}rewrite-includes-missing.c"{{$}}
// CHECK-NEXT: {{^}}# 4 "{{.*}}rewrite-includes-missing.c"{{$}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/plugins.c
|
// RUN: %clang_cc1 -load %llvmshlibdir/PrintFunctionNames%pluginext -plugin print-fns %s 2>&1 | FileCheck %s
// REQUIRES: plugins, examples
// CHECK: top-level-decl: "x"
void x();
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/warning-options.cpp
|
// RUN: %clang_cc1 -Wmonkey -Wno-monkey -Wno-unused-command-line-arguments \
// RUN: -Wno-unused-command-line-argument -Wmodule-build -Rmodule-built %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'?
// CHECK: unknown warning option '-Wmodule-build'; did you mean '-Wmodule-conflict'?
// CHECK: unknown remark option '-Rmodule-built'; did you mean '-Rmodule-build'?
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/ast-main.c
|
// RUN: %clang -emit-llvm -S -o %t1.ll -x c - < %s
// RUN: %clang -emit-ast -o %t.ast %s
// RUN: %clang -emit-llvm -S -o %t2.ll -x ast - < %t.ast
// RUN: diff %t1.ll %t2.ll
int main() {
return 0;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/gnu-inline.c
|
// RUN: %clang_cc1 -std=c89 -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
// RUN: %clang_cc1 -std=c99 -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=STDC-INLINE %s
// RUN: %clang_cc1 -std=c99 -fgnu89-inline -fsyntax-only -x c -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
// RUN: %clang_cc1 -fsyntax-only -x c++ -E -dM %s | FileCheck --check-prefix=GNU-INLINE %s
// RUN: not %clang_cc1 -fgnu89-inline -fsyntax-only -x c++ %s 2>&1 | FileCheck --check-prefix=CXX %s
// CXX: '-fgnu89-inline' not allowed with 'C++/ObjC++'
// STDC-INLINE-NOT: __GNUC_GNU_INLINE__
// STDC-INLINE: #define __GNUC_STDC_INLINE__ 1
// STDC-INLINE-NOT: __GNUC_GNU_INLINE__
// GNU-INLINE-NOT: __GNUC_STDC_INLINE__
// GNU-INLINE: #define __GNUC_GNU_INLINE__ 1
// GNU-INLINE-NOT: __GNUC_STDC_INLINE__
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/x86-target-cpu.c
|
// Ensure we support the various CPU names.
//
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu nocona -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu core2 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu penryn -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu nehalem -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu westmere -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu sandybridge -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu ivybridge -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu haswell -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu broadwell -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu bonnell -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu silvermont -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu k8 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu opteron -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu athlon64 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu athlon-fx -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu k8-sse3 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu opteron-sse3 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu athlon64-sse3 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu amdfam10 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu barcelona -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu bdver1 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu bdver2 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu bdver3 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu bdver4 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu btver1 -verify %s
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -target-cpu btver2 -verify %s
//
// expected-no-diagnostics
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/rewrite-includes-warnings.c
|
// RUN: %clang_cc1 -verify -Wall -Wextra -E -frewrite-includes %s
// expected-no-diagnostics
#pragma GCC visibility push (default)
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/invalid-o-level.c
|
// RUN: %clang_cc1 %s -O900 -o /dev/null 2>&1 | FileCheck %s
// RUN: %clang_cc1 %s -O8 -o /dev/null 2>&1 | FileCheck %s
// CHECK: warning: optimization level '-O{{.*}}' is not supported; using '-O3' instead
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/diagnostics-option-names.c
|
// RUN: not %clang_cc1 -fdiagnostics-show-option -Werror -Weverything %s 2> %t
// RUN: FileCheck < %t %s
int f0(int, unsigned);
int f0(int x, unsigned y) {
// CHECK: comparison of integers of different signs{{.*}} [-Werror,-Wsign-compare]
return x < y; // expected-error {{ : 'int' and 'unsigned int' }}
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/plugin-delayed-template.cpp
|
// RUN: %clang_cc1 -fdelayed-template-parsing -load %llvmshlibdir/PrintFunctionNames%pluginext -plugin print-fns -plugin-arg-print-fns -parse-template -plugin-arg-print-fns ForcedTemplate %s 2>&1 | FileCheck %s
// REQUIRES: plugins, examples
template <typename T>
void TemplateDep();
// CHECK: top-level-decl: "ForcedTemplate"
// The plugin should force parsing of this template, even though it's
// not used and -fdelayed-template-parsing is specified.
// CHECK: warning: expression result unused
// CHECK: late-parsed-decl: "ForcedTemplate"
template <typename T>
void ForcedTemplate() {
TemplateDep<T>(); // Shouldn't crash.
""; // Triggers the warning checked for above.
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/warning-mapping-3.c
|
// Check that -Werror and -Wfatal-error interact properly.
//
// Verify mode doesn't work with fatal errors, just use FileCheck here.
//
// RUN: not %clang_cc1 -Wunused-function -Werror -Wfatal-errors %s 2> %t.err
// RUN: FileCheck < %t.err %s
// CHECK: fatal error: unused function
// CHECK: 1 error generated
static void f0(void) {} // expected-fatal {{unused function}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes7.h
|
#ifndef REWRITE_INCLUDES_7
#define REWRITE_INCLUDES_7
included_line7
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/test2.h
|
int x;
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes1.h
|
#pragma clang system_header
included_line1
#include "rewrite-includes2.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes5.h
|
included_line5
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes-messages.h
|
void f()
{
int unused_variable;
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes4.h
|
included_line4
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes2.h
|
included_line2
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes6.h
|
#pragma once
included_line6
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/test.h
|
#include "test2.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes8.h
|
#if __has_include_next(<rewrite-includes8.h>)
#elif __has_include(<rewrite-includes8.hfail>)
#endif
#if !__has_include("rewrite-includes8.h")
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/test3.h
|
int y;
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes3.h
|
included_line3
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/rewrite-includes-bom.h
|
// This file starts with UTF-8 BOM marker.
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/TestFramework.framework
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/TestFramework.framework/Headers/TestFramework.h
|
static int f0(void) {}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/all.h
|
#include "libs/boost/all.h"
#include "libs/mylib/all.h"
#include "libs/boost/warn.h"
#include "libs/mylib/warn.h"
#include "src/warn.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/src/warn.h
|
#if SRC
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/all.h
|
#include "warn.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/boost/warn.h
|
#if BOOST
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/all.h
|
#include "warn.h"
|
0 |
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs
|
repos/DirectXShaderCompiler/tools/clang/test/Frontend/Inputs/SystemHeaderPrefix/libs/mylib/warn.h
|
#if MYLIB
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/warn-date-time.c
|
// RUN: %clang_cc1 -Wdate-time -Wno-builtin-macro-redefined %s -verify -E
// RUN: %clang_cc1 -Wdate-time -Wno-builtin-macro-redefined %s -DIS_SYSHEADER -verify -E
// RUN: not %clang_cc1 -Werror=date-time -Wno-builtin-macro-redefined %s -DIS_SYSHEADER -E 2>&1 | grep 'error: expansion' | count 3
#ifdef IS_HEADER
#ifdef IS_SYSHEADER
#pragma clang system_header
#endif
__TIME__ // expected-warning {{expansion of date or time macro is not reproducible}}
__DATE__ // expected-warning {{expansion of date or time macro is not reproducible}}
__TIMESTAMP__ // expected-warning {{expansion of date or time macro is not reproducible}}
#define __TIME__
__TIME__
#else
#define IS_HEADER
#include __FILE__
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/c90.c
|
/* RUN: %clang_cc1 -std=c90 -fsyntax-only %s -verify -pedantic-errors
*/
enum { cast_hex = (long) (
0x0p-1 /* expected-error {{hexadecimal floating constants are a C99 feature}} */
) };
/* PR2477 */
int test1(int a,int b) {return a//* This is a divide followed by block comment in c89 mode */
b;}
// comment accepted as extension /* expected-error {{// comments are not allowed in this language}}
void test2() {
const char * str =
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds" // expected-error{{string literal of length 845 exceeds maximum length 509 that C90 compilers are required to support}}
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds"
"sdjflksdjf lksdjf skldfjsdkljflksdjf kldsjflkdsj fldks jflsdkjfds";
}
void test3() {
(void)L"\u1234"; // expected-error {{universal character names are only valid in C99 or C++}}
(void)L'\u1234'; // expected-error {{universal character names are only valid in C99 or C++}}
}
#define PREFIX(x) foo ## x
int test4() {
int PREFIX(0p) = 0;
int *p = &PREFIX(0p+1);
return p[-1];
}
#define MY_UCN \u00FC // expected-warning {{universal character names are only valid in C99 or C++; treating as '\' followed by identifier}}
#define NOT_A_UCN \h // no-warning
extern int idWithUCN\u00FC; // expected-warning {{universal character names are only valid in C99 or C++; treating as '\' followed by identifier}} expected-error {{expected ';'}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/eof-include.c
|
// RUN: %clang_cc1 %s -verify
// vim: set binary noeol:
// This file intentionally ends without a \n on the last line. Make sure your
// editor doesn't add one.
// expected-error@+1{{expected "FILENAME" or <FILENAME>}}
#include <\
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_c1x.c
|
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=iso9899:199409 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=c11 %s -o - | FileCheck --check-prefix=CHECK-1X %s
//
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu89 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu99 %s -o - | FileCheck --check-prefix=CHECK-NO-1X %s
// RUN: %clang_cc1 -E -triple x86_64-linux-gnu -std=gnu11 %s -o - | FileCheck --check-prefix=CHECK-1X %s
#if __has_feature(c_atomic)
int has_atomic();
#else
int no_atomic();
#endif
// CHECK-1X: has_atomic
// CHECK-NO-1X: no_atomic
#if __has_feature(c_static_assert)
int has_static_assert();
#else
int no_static_assert();
#endif
// CHECK-1X: has_static_assert
// CHECK-NO-1X: no_static_assert
#if __has_feature(c_generic_selections)
int has_generic_selections();
#else
int no_generic_selections();
#endif
// CHECK-1X: has_generic_selections
// CHECK-NO-1X: no_generic_selections
#if __has_feature(c_alignas)
int has_alignas();
#else
int no_alignas();
#endif
// CHECK-1X: has_alignas
// CHECK-NO-1X: no_alignas
#if __has_feature(c_alignof)
int has_alignof();
#else
int no_alignof();
#endif
// CHECK-1X: has_alignof
// CHECK-NO-1X: no_alignof
#if __has_feature(c_thread_local)
int has_thread_local();
#else
int no_thread_local();
#endif
// CHECK-1X: has_thread_local
// CHECK-NO-1X: no_thread_local
#if __STDC_VERSION__ > 199901L
int is_c1x();
#else
int is_not_c1x();
#endif
// CHECK-1X: is_c1x
// CHECK-NO-1X: is_not_c1x
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/multiple-include.c
|
// RUN: %clang_cc1 %s -fsyntax-only
#ifndef XVID_AUTO_INCLUDE
#define XVID_AUTO_INCLUDE
#define FUNC_H H_Pass_16_C
#include "multiple-include.c"
#define FUNC_H H_Pass_8_C
#include "multiple-include.c"
#undef XVID_AUTO_INCLUDE
typedef void ff();
typedef struct { ff *a;} S;
S s = { H_Pass_8_C };
#endif
#if defined(XVID_AUTO_INCLUDE) && defined(REFERENCE_CODE)
#elif defined(XVID_AUTO_INCLUDE) && !defined(REFERENCE_CODE)
static void FUNC_H(){};
#undef FUNC_H
#endif
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/eof-number.c
|
// RUN: %clang_cc1 %s -verify -fsyntax-only -Wnewline-eof
// vim: set binary noeol:
// This file intentionally ends without a \n on the last line. Make sure your
// editor doesn't add one.
// expected-error@+2{{unterminated conditional directive}}
// expected-warning@+1{{no newline at end of file}}
#if 0
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/pragma-message.c
|
/* Test pragma message directive from
http://msdn.microsoft.com/en-us/library/x7dkzch2.aspx */
// message: Sends a string literal to the standard output without terminating
// the compilation.
// #pragma message(messagestring)
// OR
// #pragma message messagestring
//
// RUN: %clang_cc1 -fsyntax-only -verify -Werror %s
#define STRING2(x) #x
#define STRING(x) STRING2(x)
#pragma message(":O I'm a message! " STRING(__LINE__)) // expected-warning {{:O I'm a message! 13}}
#pragma message ":O gcc accepts this! " STRING(__LINE__) // expected-warning {{:O gcc accepts this! 14}}
#pragma message(invalid) // expected-error {{expected string literal in pragma message}}
// GCC supports a similar pragma, #pragma GCC warning (which generates a warning
// message) and #pragma GCC error (which generates an error message).
#pragma GCC warning(":O I'm a message! " STRING(__LINE__)) // expected-warning {{:O I'm a message! 21}}
#pragma GCC warning ":O gcc accepts this! " STRING(__LINE__) // expected-warning {{:O gcc accepts this! 22}}
#pragma GCC error(":O I'm a message! " STRING(__LINE__)) // expected-error {{:O I'm a message! 24}}
#pragma GCC error ":O gcc accepts this! " STRING(__LINE__) // expected-error {{:O gcc accepts this! 25}}
#define COMPILE_ERROR(x) _Pragma(STRING2(GCC error(x)))
COMPILE_ERROR("Compile error at line " STRING(__LINE__) "!"); // expected-error {{Compile error at line 28!}}
#pragma message // expected-error {{pragma message requires parenthesized string}}
#pragma GCC warning("" // expected-error {{pragma warning requires parenthesized string}}
#pragma GCC error(1) // expected-error {{expected string literal in pragma error}}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/rdr-6096838.c
|
/* RUN: %clang_cc1 -triple i386-unknown-unknown -fsyntax-only -verify %s
* RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=gnu89 -fsyntax-only -verify %s
rdar://6096838
*/
// expected-no-diagnostics
long double d = 0x0.0000003ffffffff00000p-16357L;
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/pragma-region.c
|
/* Test pragma region directive from
http://msdn.microsoft.com/en-us/library/b6xkz944(v=vs.80).aspx */
// Editor-only pragma, just skipped by compiler.
// Syntax:
// #pragma region optional name
// #pragma endregion optional comment
//
// RUN: %clang_cc1 -fsyntax-only -verify -Wall -fms-extensions %s
#pragma region
/* inner space */
#pragma endregion
#pragma region long name
/* inner space */
void foo(void){}
#pragma endregion long comment
void inner();
__pragma(region) // no sense, but ignored
_Pragma("region")// ditto
#pragma region2 // expected-warning {{unknown pragma ignored}}
#pragma region one
#pragma region inner
//#pragma endregion inner
#pragma endregion end
// {{unclosed pragma region}} - region mismatches is not detected yet
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/has_feature_exceptions.cpp
|
// RUN: %clang -E -fexceptions %s -o - | FileCheck --check-prefix=CHECK-EXCEPTIONS %s
// RUN: %clang -E -fexceptions -fno-cxx-exceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
// RUN: %clang -E -fno-exceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
// RUN: %clang_cc1 -E -fcxx-exceptions %s -o - | FileCheck --check-prefix=CHECK-EXCEPTIONS %s
// RUN: %clang_cc1 -E -fobjc-exceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
// RUN: %clang_cc1 -E -fexceptions %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
// RUN: %clang_cc1 -E %s -o - | FileCheck --check-prefix=CHECK-NO-EXCEPTIONS %s
#if __has_feature(cxx_exceptions)
int foo();
#else
int bar();
#endif
// CHECK-EXCEPTIONS: foo
// CHECK-NO-EXCEPTIONS: bar
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/string_concat.cpp
|
// RUN: %clang_cc1 -std=c++11 -fsyntax-only -verify %s
// RUN: %clang_cc1 -std=c11 -x c -fsyntax-only -verify %s
#ifndef __cplusplus
typedef __WCHAR_TYPE__ wchar_t;
typedef __CHAR16_TYPE__ char16_t;
typedef __CHAR32_TYPE__ char32_t;
#endif
void f() {
const char* a = u8"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char* b = u8"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char* c = u8"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
#ifdef __cplusplus
const char* d = u8"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char* e = u8"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char* f = u8"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
#endif
const char16_t* g = u"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char16_t* h = u"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char16_t* i = u"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
#ifdef __cplusplus
const char16_t* j = u"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char16_t* k = u"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char16_t* l = u"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
#endif
const char32_t* m = U"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char32_t* n = U"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char32_t* o = U"abc" L"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
#ifdef __cplusplus
const char32_t* p = U"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char32_t* q = U"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const char32_t* r = U"abc" LR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
#endif
const wchar_t* s = L"abc" u8"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const wchar_t* t = L"abc" u"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
const wchar_t* u = L"abc" U"abc"; // expected-error {{unsupported non-standard concatenation of string literals}}
#ifdef __cplusplus
const wchar_t* v = L"abc" u8R"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const wchar_t* w = L"abc" uR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
const wchar_t* x = L"abc" UR"(abc)"; // expected-error {{unsupported non-standard concatenation of string literals}}
#endif
}
|
0 |
repos/DirectXShaderCompiler/tools/clang/test
|
repos/DirectXShaderCompiler/tools/clang/test/Lexer/pragma-mark.c
|
// RUN: %clang_cc1 %s -fsyntax-only -verify
// expected-no-diagnostics
// Lexer diagnostics shouldn't be included in #pragma mark.
#pragma mark Mike's world
_Pragma("mark foo ' bar")
#define X(S) _Pragma(S)
X("mark foo ' bar")
int i;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.