1 /// Check the behavior of toolchain for NEC Aurora VE
2 /// REQUIRES: ve-registered-target
3 
4 ///-----------------------------------------------------------------------------
5 /// Checking dwarf-version
6 
7 // RUN: %clangxx -### -g -target ve %s 2>&1 | FileCheck -check-prefix=DWARF_VER %s
8 // DWARF_VER: "-dwarf-version=4"
9 
10 ///-----------------------------------------------------------------------------
11 /// Checking dynamic-linker
12 
13 // RUN: %clangxx -### -target ve %s 2>&1 | FileCheck -check-prefix=DYNLINKER %s
14 // DYNLINKER: nld{{.*}} "-dynamic-linker" "/opt/nec/ve/lib/ld-linux-ve.so.1"
15 
16 ///-----------------------------------------------------------------------------
17 /// Checking VE specific option
18 
19 // RUN: %clangxx -### -target ve %s 2>&1 | FileCheck -check-prefix=VENLDOPT %s
20 // VENLDOPT: nld{{.*}} "-z" "max-page-size=0x4000000"
21 
22 ///-----------------------------------------------------------------------------
23 /// Checking include-path
24 
25 // RUN: %clangxx -### -target ve %s 2>&1 | FileCheck -check-prefix=DEFINC %s
26 // DEFINC: clang{{.*}} "-cc1"
27 // DEFINC: "-nostdsysteminc"
28 // DEFINC: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include/c++/v1"
29 // DEFINC: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include"
30 // DEFINC: "-internal-isystem" "/opt/nec/ve/include"
31 
32 // RUN: %clangxx -### -target ve %s -nostdlibinc 2>&1 | \
33 // RUN:    FileCheck -check-prefix=NOSTDLIBINC %s
34 // NOSTDLIBINC: clang{{.*}} "-cc1"
35 // NOSTDLIBINC-NOT: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include/c++/v1"
36 // NOSTDLIBINC: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include"
37 // NOSTDLIBINC-NOT: "-internal-isystem" "/opt/nec/ve/include"
38 
39 // RUN: %clangxx -### -target ve %s -nobuiltininc 2>&1 | \
40 // RUN:    FileCheck -check-prefix=NOBUILTININC %s
41 // NOBUILTININC: clang{{.*}} "-cc1"
42 // NOBUILTININC: "-nobuiltininc"
43 // NOBUILTININC: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include/c++/v1"
44 // NOBUILTININC-NOT: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include"
45 // NOBUILTININC: "-internal-isystem" "/opt/nec/ve/include"
46 
47 // RUN: %clangxx -### -target ve %s -nostdinc 2>&1 | \
48 // RUN:    FileCheck -check-prefix=NOSTDINC %s
49 // NOSTDINC: clang{{.*}} "-cc1"
50 // NOSTDINC: "-nobuiltininc"
51 // NOSTDINC-NOT: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include/c++/v1"
52 // NOSTDINC-NOT: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include"
53 // NOSTDINC-NOT: "-internal-isystem" "/opt/nec/ve/include"
54 
55 // RUN: %clangxx -### -target ve %s -nostdinc++ 2>&1 | \
56 // RUN:    FileCheck -check-prefix=NOSTDINCXX %s
57 // NOSTDINCXX: clang{{.*}} "-cc1"
58 // NOSTDINCXX: "-nostdinc++"
59 // NOSTDINCXX-NOT: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include/c++/v1"
60 // NOSTDINCXX: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include"
61 // NOSTDINCXX: "-internal-isystem" "/opt/nec/ve/include"
62 
63 ///-----------------------------------------------------------------------------
64 /// Checking environment variable NCC_CPLUS_INCLUDE_PATH
65 
66 // RUN: env NCC_CPLUS_INCLUDE_PATH=/test/test %clangxx -### -target ve %s \
67 // RUN:    2>&1 | FileCheck -check-prefix=DEFINCENV %s
68 
69 // DEFINCENV: clang{{.*}} "-cc1"
70 // DEFINCENV: "-nostdsysteminc"
71 // DEFINCENV: "-internal-isystem" "/test/test"
72 // DEFINCENV: "-internal-isystem" "{{.*}}/lib/clang/{{[0-9.]*}}/include"
73 // DEFINCENV: "-internal-isystem" "/opt/nec/ve/include"
74 
75 ///-----------------------------------------------------------------------------
76 /// Checking -fuse-init-array
77 
78 // RUN: %clangxx -### -target ve %s 2>&1 | FileCheck -check-prefix=DEFINITARRAY %s
79 // DEFINITARRAY: clang{{.*}} "-cc1"
80 // DEFINITARRAY-NOT: "-fuse-init-array"
81 
82 // RUN: %clangxx -### -target ve %s -fno-use-init-array 2>&1 | \
83 // RUN:     FileCheck -check-prefix=NOTINITARRAY %s
84 // NOTINITARRAY: clang{{.*}} "-cc1"
85 // NOTINITARRAY: "-fno-use-init-array"
86 
87 ///-----------------------------------------------------------------------------
88 /// Checking -faddrsig
89 
90 // RUN: %clangxx -### -target ve %s 2>&1 | FileCheck -check-prefix=DEFADDESIG %s
91 // DEFADDESIG: clang{{.*}} "-cc1"
92 // DEFADDESIG-NOT: "-faddrsig"
93 
94 // RUN: %clangxx -### -target ve %s -faddrsig 2>&1 | \
95 // RUN:     FileCheck -check-prefix=ADDRSIG %s
96 // ADDRSIG: clang{{.*}} "-cc1"
97 // ADDRSIG: "-faddrsig"
98 
99 // RUN: %clangxx -### -target ve %s -fno-addrsig 2>&1 | \
100 // RUN:     FileCheck -check-prefix=NOADDRSIG %s
101 // NOADDRSIG: clang{{.*}} "-cc1"
102 // NOADDRSIG-NOT: "-faddrsig"
103 
104 ///-----------------------------------------------------------------------------
105 /// Checking exceptions
106 
107 // RUN: %clangxx -### -target ve %s 2>&1 | FileCheck -check-prefix=DEFEXCEPTION %s
108 // DEFEXCEPTION: clang{{.*}} "-cc1"
109 // DEFEXCEPTION: "-fsjlj-exceptions"
110 
111 ///-----------------------------------------------------------------------------
112 /// Passing -fintegrated-as
113 
114 // RUN: %clangxx -### -target ve -x assembler %s 2>&1 | \
115 // RUN:    FileCheck -check-prefix=AS_LINK %s
116 // RUN: %clangxx -### -target ve -fno-integrated-as -x assembler %s 2>&1 | \
117 // RUN:    FileCheck -check-prefix=NAS_LINK %s
118 
119 // AS_LINK: clang{{.*}} "-cc1as"
120 // AS_LINK: nld{{.*}}
121 
122 // NAS_LINK: nas{{.*}}
123 // NAS_LINK: nld{{.*}}
124 
125 ///-----------------------------------------------------------------------------
126 /// Checking default libraries
127 
128 // RUN: %clangxx -### -target ve --stdlib=c++ %s 2>&1 | \
129 // RUN:    FileCheck -check-prefix=LINK %s
130 
131 // LINK: clang{{.*}} "-cc1"
132 // LINK: nld{{.*}} "{{.*}}/crt1.o" "{{.*}}/crti.o"{{.*}}"crtbegin.o"{{.*}}"-lc++" "-lc++abi" "-lunwind" "-lpthread" "-ldl"
133