CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
114 lines
2.7 KiB
C
114 lines
2.7 KiB
C
// REQUIRES: host-supports-jit
|
|
// RUN: cat %s | clang-repl -Xcc -xc | FileCheck %s
|
|
// RUN: cat %s | clang-repl -Xcc -std=c++11 | FileCheck %s
|
|
// RUN: cat %s | clang-repl -Xcc -xc -Xcc -std=c89 | FileCheck %s
|
|
|
|
// UNSUPPORTED: hwasan, msan
|
|
|
|
|
|
char c = 'a'; c
|
|
// CHECK: (char) 'a'
|
|
|
|
const char* c_str = "Hello, world!"; c_str
|
|
// CHECK-NEXT: (const char *) "Hello, world!"
|
|
|
|
c_str = "Goodbye, world!"; c_str
|
|
// CHECK-NEXT: (const char *) "Goodbye, world!"
|
|
|
|
const char* c_null_str = 0; c_null_str
|
|
// CHECK-NEXT: (const char *) 0
|
|
|
|
"Hello, world"
|
|
// CHECK-NEXT: ({{(const )?}}char[13]) "Hello, world"
|
|
|
|
printf("Hello World\n");
|
|
// expected-error {{call to undeclared library function 'printf' with type 'int (const char *, ...)' }}
|
|
|
|
int x = 42; x
|
|
// CHECK-NEXT: (int) 42
|
|
|
|
&x
|
|
// CHECK-NEXT: (int *) 0x{{[0-9a-f]+}}
|
|
|
|
x - 2
|
|
// CHECK-NEXT: (int) 40
|
|
|
|
float f = 4.2f; f
|
|
// CHECK-NEXT: (float) 4.20000f
|
|
|
|
double d = 4.21; d
|
|
// CHECK-NEXT: (double) 4.2100000
|
|
|
|
long double tau = 6.2831853; tau
|
|
// CHECK-NEXT: (long double) 6.28318530000L
|
|
|
|
int foo() { return 42; } foo()
|
|
// CHECK-NEXT: (int) 42
|
|
|
|
void bar(int a, float b) {} bar
|
|
// CHECK-NEXT: (void (int, float)) Function @0x{{[0-9a-f]+}}
|
|
// CHECK-NEXT: void bar(int a, float b) {
|
|
|
|
bar
|
|
// CHECK: (void (int, float)) Function @0x{{[0-9a-f]+}}
|
|
// CHECK-NEXT: void bar(int a, float b) {
|
|
|
|
// Arrays.
|
|
|
|
int arr[3] = {1,2,3}; arr
|
|
// CHECK: (int[3]) { 1, 2, 3 }
|
|
|
|
double darr[3][4] = { {1,2,3,4}, {5,6,7,8}, {9,10,11,12} }; darr
|
|
// CHECK-NEXT: (double[3][4]) { { 1.0, 2.0, 3.0, 4.0 }, { 5.0, 6.0, 7.0, 8.0 }, { 9.0, 10.0, 11.0, 12.0 } }
|
|
|
|
float farr[2][1] = { {0}, {3.14}}; farr
|
|
// CHECK-NEXT: (float[2][1]) { { 0.0f }, { 3.14000f } }
|
|
|
|
0./0.
|
|
// CHECK-NEXT: (double) nan
|
|
|
|
1.0f / 0.0f
|
|
// CHECK-NEXT: (float) inf
|
|
|
|
0.00001f
|
|
// CHECK-NEXT: (float) 1.00000e-05f
|
|
|
|
int * ptr = (int*)0x123; ptr
|
|
// CHECK-NEXT: (int *) 0x123
|
|
|
|
int * null_ptr = (int*)0; null_ptr
|
|
// CHECK-NEXT: (int *) 0x0
|
|
|
|
union U { int I; float F; } u; u.I = 12; u.I
|
|
// CHECK-NEXT: (int) 12
|
|
|
|
struct S1{} s1; s1
|
|
// CHECK-NEXT: (S1 &) @0x{{[0-9a-f]+}}
|
|
|
|
struct S2 {int d;} E = {22}; E
|
|
// CHECK-NEXT: (S2 &) @0x{{[0-9a-f]+}}
|
|
|
|
E.d
|
|
// CHECK-NEXT: (int) 22
|
|
|
|
// TODO: _Bool, _Complex, _Atomic, and _BitInt
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// Tentative definition handling (C99 6.9.2)
|
|
// Verify that multiple distinct tentative definitions across inputs no longer
|
|
// conflict. Each variable should emit correctly in its own incremental module.
|
|
// -----------------------------------------------------------------------------
|
|
|
|
int t1;
|
|
int t2;
|
|
int t3;
|
|
t1 = 1; t2 = 2; t3 = 3;
|
|
t1 + t2 + t3
|
|
// CHECK-NEXT: (int) 6
|
|
|
|
// A redefinition of an existing tentative variable should still fail.
|
|
int t1;
|
|
// expected-error {{duplicate definition of symbol '_t1'}}
|
|
|
|
%quit
|