[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / ByteCode / codegen.c
blob3c6f17e2b87264896d651bc25a035bb3077169d0
1 // RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-linux -emit-llvm -o - %s -fexperimental-new-constant-interpreter | FileCheck %s
4 typedef __INTPTR_TYPE__ intptr_t;
6 const intptr_t Z1 = (intptr_t)(((char*)-1LL) + 1);
7 // CHECK: @Z1 = constant i64 0
9 const intptr_t Z2 = (intptr_t)(((char*)1LL) - 1);
10 // CHECK: @Z2 = constant i64 0
12 struct A {
13 char num_fields;
15 struct B {
16 char a, b[1];
18 const int A = (char *)(&( (struct B *)(16) )->b[0]) - (char *)(16);
19 // CHECK: @A = constant i32 1
21 struct X { int a[2]; };
22 int test(void) {
23 static int i23 = (int) &(((struct X *)0)->a[1]);
24 return i23;
26 // CHECK: @test.i23 = internal global i32 4, align 4